码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-09-14 23:41:02      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:sel   ediff   rom   nbsp   date   ase   when   ted   日期   

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 确定两个日期之间的秒、分、小时数

标签:sel   ediff   rom   nbsp   date   ase   when   ted   日期   

原文地址:http://www.cnblogs.com/liang545621/p/7523308.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!