get the 4 th maximum salary from a table without using any sql keyword (TOP,MAX are mot allowed)


select ename,Salary from Emp a group by Ename,Salary
   having 4=(select COUNT(distinct( salary) )from Emp b where a.salary<=b.Salary)

Comments

Popular posts from this blog

i am writing With sad hearts some problems with my windows phone samsung omnia w

Delete Duplicate Records in DataBase sql server