sqlserver 查询日期

查询两个特定日期之间的所有时间

 

1。select dt=dateadd(hh,rn*4,'2009-01-01 00:00:00')
from (select rn=row_number() over(order by getdate())-1 from sysobjects,syscolumns) t
where dateadd(hh,rn*4,'2009-01-01 00:00:00')<='2010-02-01 00:00:00'
(case ys.yslx when 0 then '正常' when 1 then '异常' else '正常' end)

你可能感兴趣的:(sqlserver)