select datediff(ward_hd,allen_hd)from (select hiredate as ward_hdfrom empwhere ename='WARD') x,(select hiredate as allen_hdfrom empwhere ename='ALLEN')y;