select mnth,mnth/12from(select (year(max_hd) - year(min_hd))*12 +(month(max_hd) - month(min_hd)) as mnthfrom (select min(hiredate) as min_hd,max(hiredate) as max_hdfrom emp) x) y;