用sql从数据库中查询出每月的记录

来源:互联网 发布:linux下apache配置文件 编辑:程序博客网 时间:2024/06/02 15:08

用sql从数据库中查询出每月的记录:
select * from table where year(日期列)=year(date) and month(日期列)=month(date)

查询最后一条记录:
select   top 1 * from table order by desc
 

原创粉丝点击