原文:Sql Server 查询指定范围(一周,一月,本周,本月等)内的数据

.查询今日的所有数据 select from 表名 where datediff day,字段名,getdate .查询昨日的所有数据 select from 表名 where datediff day,字段名,getdate .查询当天日期在一周年的数据 selcet from 表名 where datediff week,字段名,getdate .查询前 天的数据 select from 表 ...

2015-05-05 15:37 0 2683 推荐指数:

查看详情

sql语句获取本周、上一周本月数据

获取周数据 本周 select * from table1 where datediff(week,时间字段,getdate()) = 0 上周 select * from table1 where datediff(week,时间字段,getdate()) = 1 下周 select ...

Fri Jan 17 22:12:00 CST 2020 0 1724
mysql 统计当天,本周,本月,上一月数据

今天 昨天 近期7天 近30天 本月 上一个 查询本季度 查询上季度 查询本年数据 查询上年数据 查询当前这周的数据 查询上周 参考 https://blog.csdn.net/yinlell/article ...

Thu Jul 04 01:46:00 CST 2019 0 1228
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM