how to find nth highest salary

Answer Posted / dinesh

select distinct(a.salary)
from Salarydtls a
where 3= (select distinct(count(b.salary))
from salarydtls b
where a.salary<=b.salary)

ans is for third highest sal

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to change server name in sql server?

674


What are statistics?

666


Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?

598


What is mssql?

650


What is open database communication (odbc)?

667






What is merge statement?

699


What are the rendering extensions of ssrs?

113


what is normalization? Explain different levels of normalization? : Sql server database administration

761


What is explicit mode in sql server?

623


What is a hint?

657


What is the recovery model?

647


How many types of stored procedures are there in sql server?

649


What are the differences between stored procedure and view in sql server?

716


Explain partitioned view?

690


What do you understand by a view?

638