日期:2014-05-18  浏览次数:20452 次

一个SQL语句,求解
elect wcsj,SPSJ,ZGSPSJ,ZJLSPSJ,djbh
from IN_GZCLDH
where ZF='N'
and ZDRQ>='2012-1-1' and ZDRQ<='2012-1-31'
and ZJLSP='同意'
and case when WCSJ is not null then DATEDIFF(HOUR,ZJLSPSJ,WCSJ) else DATEDIFF(HOUR,ZJLSPSJ,GETDATE()) end>24



最后END>24代表什么意思,小弟求解

------解决方案--------------------
SQL code

elect wcsj,SPSJ,ZGSPSJ,ZJLSPSJ,djbh
from IN_GZCLDH
where ZF='N'
and ZDRQ>='2012-1-1' and ZDRQ<='2012-1-31'
and ZJLSP='同意'
and )case when WCSJ is not null then DATEDIFF(HOUR,ZJLSPSJ,WCSJ) else DATEDIFF(HOUR,ZJLSPSJ,GETDATE()) end)>24

--加个括号你就能看懂了吧!也就是时间差的返回值大于24