Please get the 4 th maximum salary from a table without
using any sql keyword (TOP,MAX are mot allowed)
Answer Posted / sumathy
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 2 from Cursor_Name
deallocate Cursor_Name
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Write a sql query to sort on different column name according to the parameters passed in the function?
To automatically record the time on which the data was modified in a table, which data type should you choose for the column?
Why SQL Agent is used?
What is the difference between deallocate cursor and close cursor?
What is store procedure?
List all types of constraints in sql server?
what is a transaction and what are acid properties? : Sql server database administration
What are the various Operating system files that every SQL server 2005 database has and what is the purpose.
Explain how many types of relationship?
explain how to create a new schema in a database? : Sql server database administration
What the difference between UNION and UNIONALL?
Write the queries for commands like Create Table, Delete table, Drop Table etc.
Why we need sql server?
What are the indexes in sql server?
What is an expensive query?