sql语句实现24小时点击排行
我是这样写的select top 10 ID,Tid,Title,Adddate from KS_Article where Adddate like '%date()%' order by Hits desc
但是查询不出来
不知道什么原因!希望赐教!
参考答案:select top 10 ID,Tid,Title,Adddate
from KS_Article
where DATEDIFF(d,Adddate,getdate())<=1 order by Hits desc