use [Tongxing]
DECLARE @days int
set @days=1000 --表示跟今天相差的天数,今天为1,一个星期内为7..
select (case when iClassID=1 then '新闻' when iClassID=2 then '生活' when iClassID=3 then '军事' when iClassID=4 then '科技' when iClassID=5 then '体育' when iClassID=6 then '财经' when iClassID=7 then '娱乐' when iClassID=8 then '文学' else '游戏' end) as 栏目,count(*) as 数量
from [Digg_article] where datediff(day,dAddTime,getdate())<@days
group by iClassID
select @days as 相差天数
DECLARE @days int
set @days=1000 --表示跟今天相差的天数,今天为1,一个星期内为7..
select (case when iClassID=1 then '新闻' when iClassID=2 then '生活' when iClassID=3 then '军事' when iClassID=4 then '科技' when iClassID=5 then '体育' when iClassID=6 then '财经' when iClassID=7 then '娱乐' when iClassID=8 then '文学' else '游戏' end) as 栏目,count(*) as 数量
from [Digg_article] where datediff(day,dAddTime,getdate())<@days
group by iClassID
select @days as 相差天数