Total Pageviews

Thursday, 19 April 2012

SQL Query to find 3rd Oldest Employee



--Solution 1
select * from
(select top 3 ROW_NUMBER() OVER(order by DateOfBirth) AS row,* from Employee)Emp
where ROW=3

--Solution 2 
select top 1 * from
(select top 3 * from Employee order by DateOfBirth) Emp order by DateOfBirth desc


if any more solution please comment

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete