1. 程式人生 > >8.05 確定兩個日期之間的秒、分、小時數

8.05 確定兩個日期之間的秒、分、小時數

max rom diff all red 日期 date edi cas

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;

8.05 確定兩個日期之間的秒、分、小時數