您的位置: bluesailor散记——
« SQL笔记:dateadd函数SQL笔记:charIndex函数 »

SQL笔记:查询当日数据

分类: 读书笔记 发布: bluesailor 浏览: 日期: 2008年8月3日

txtsql="select count(*)  from seekfor where datediff(day,sf_date,getdate())=0"
txtsql="select count(*)  from seekfor where sf_date>=convert(char(10),getdate(),120) and sf_date<convert(char(10),getdate()+1,120)"

这两句都是查询当天数据量的

由于在字段上使用了函数,第一句效率要低些.

 

相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-Blog 1.8 Spirit Build 80722

Copyright Lunji.com Some Rights Reserved.