8.5 确定两个日期之间的秒、分、小时数

select datediff(ward_hd,allen_hd)*24 hr,
             datediff(ward_hd,allen_hd)*24*60 min,
             datediff(ward_hd,allen_hd)*24*60*60 sec
from (  
select max(case when ename='WARD'
then hiredate
end) as ward_hd,
max(case when ename='ALLEN'
then hiredate
end ) as allen_hd
from emp
) x;             

posted @ 2017-09-14 22:00  屠魔的少年  阅读(185)  评论(0)    收藏  举报