Saturday, 7 November 2009

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

Create Table 'Employee' with columns 'Emp_Name'
and 'Salary'. And, Insert some data.....

Cursor:
declare Cursor_Name cursor scroll
for select salary from Emploee order by salary desc
open Cursor_Name
fetch absolute 4 from Cursor_Name
deallocate Cursor_Name