日期:2014-05-18 浏览次数:20522 次
select USERID,PCS=(case when datediff(dd,TODAY,getdate())=0 then PCS else 0 end) from SH
------解决方案--------------------
SELECT *
,CASE WHEN CONVERT(VARCHAR(10),TODAY,120)=CONVERT(VARCHAR(10),GETDATE(),120) THEN 'pcs' ELSE '0' END
FROM SH
------解决方案--------------------
select userid ,case when datediff(d,today,getdate()) = 0 then pcs else 0 end from sh