Method 1:select top(1) * from employee order by datediff(dd,birthdate,employment_date)union allselect top(1) * from employee order by datediff(dd,birthdate,employment_date) desc
Method 2:select name ,birthday ,employment_date from (select * ,row_number() over(order by datediff(dd,birthdate,employment_date)) as rn_min ,row_number() over(order by datediff(dd,birthdate,employment_date) desc) as rn_max from employee ) as a where rn_min=1 or rn_max=1
Ps: I have no access to a database server to test the syntax, but should be ok (I think)