11,849
社区成员
发帖
与我相关
我的任务
分享
还有2小时下班
select DATEDIFF(ss,getdate(),'2011-03-29 18:00:00.000')
/
-----------
7967
(1 行受影响)*/
select (to_date('2011-03-29 18:00:00','yyyy-mm-dd hh24:MI:ss')-sysdate)*24*60*60 from dual;
----------------------------------------
1100
select (to_date('2011-03-29 18:00:00','yyyy-mm-dd hh24:MI:ss')-sysdate)*24*60*60 from dual;
--还是鸭子狠些
WAITFOR DELAY '00:00:01'
PRINT '距离下班还有'+LTRIM(DATEDIFF(ss,getdate(),'2011-03-29 18:00:00.000'))+'秒'
GO 100000
select DATEDIFF(ss,getdate(),'2011-03-29 18:00:00.000')
/*
-----------
7492
select DATEDIFF(ss,getdate(),'2011-03-29 18:00:00.000')
/*
-----------
7890
(1 行受影响)
*/
select DATEDIFF(ss,getdate(),'2011-03-29 18:00:00.000')
/*
-----------
7913
(1 行受影响)*/