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


Please Help Members By Posting Answers For Below Questions

How to use subqueries with the in operators in ms sql server?

741


What are the restraints imposed on the table design by a merge replication?

783


How would we use distinct statement? What is its use?

775


Explain what is public role in sql server?

777


How many replicas are maintained for each SQL Azure database?

138






What Is Rdbms?

834


Is sql server 2016 free?

688


If no size is defined while creating the database, what size will the database have?

734


Explain in details security in SQL azure?

115


How to loop through result set objects using mssql_fetch_array()?

732


What are the indexes in sql server?

694


Is resultset an interface?

707


Are all views updatable ?

886


what's the difference between delete table and truncate table commands? : Sql server database administration

667


What is user defined datatypes and when you should go for them?

760