SQL 查询本周/本月/本季度/本年的数据
2012-02-14 18:03
696 查看
本周数据:select * from Keywords where datediff(week, Addtime,getdate())=0
本月:select * from Keywords where datediff(month, Addtime,getdate())=0
本季度:select * from Keywords where datediff(quarter, Addtime,getdate())=0
本年:select * from Keywords where datediff(year, Addtime,getdate())=0
本月:select * from Keywords where datediff(month, Addtime,getdate())=0
本季度:select * from Keywords where datediff(quarter, Addtime,getdate())=0
本年:select * from Keywords where datediff(year, Addtime,getdate())=0
相关文章推荐
- Sql Server中查询当天,最近三天,本周,本月,最近一个月,本季度的数据的sql语句
- sql server2008 查询当天,最近三天,本周,本月,最近一个月,本季度的数据的sql语句
- Sql Server中查询当天,最近三天,本周,本月,最近一个月,本季度的数据的sql语句
- MySQL查询本周、上周、本月、上个月份数据的sql代码
- oracle 查询本周,本月,本年数据
- sql查询本周本月本年
- MySQL查询本周、上周、本月、上个月份数据的sql代码
- MySQL查询今天、昨天、本周、本月、本季、本年的数据
- MySQL查询本周、上周、本月、上个月份数据的sql代码
- sql 查询本月,本周和当天的数据,sql 日期函数
- MySQL查询本周、上周、本月、上个月份数据的sql脚本
- thinkphp 查询当天 ,本周,本月,本季度,本年度,全部, 数据方法
- oracle 查询本周,本月,本年数据
- thinkphp 3.2.3按今天,本周,本月,本季度,本年,全部查询
- SQL Server中查询本周 本月 本期, 本年的记录 本月统计、本周统计和本季度
- SQL 查询本周本月及时间段的数据
- 利用liyfmdb框架,实现本周,本月,本日,本季度,本年的sqlite查询
- MySQL查询本周、上周、本月、上个月份数据的sql代码
- MySQL查询本周、上周、本月、上个月份数据的sql代码
- 选择时间段本周、本月、本季度、本年的条件来查询