select mnth,mnth/12
from
(select (year(max_hd) - year(min_hd))*12 +
(month(max_hd) - month(min_hd)) as mnth
from (
select min(hiredate) as min_hd,max(hiredate) as max_hd
from emp
) x
) y;
时间: 2024-10-16 17:39:12
select mnth,mnth/12
from
(select (year(max_hd) - year(min_hd))*12 +
(month(max_hd) - month(min_hd)) as mnth
from (
select min(hiredate) as min_hd,max(hiredate) as max_hd
from emp
) x
) y;