how to find nth highest salary

Answer Posted / mohd javed

BY Tested in Postgres SQL : javedcc@gmail.com

select * from tablename as aliasname where (nth)= (select
count(sal) from tablename where aliasname.sal<=sal)

Is This Answer Correct ?    8 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

634


How to update multiple rows with one update statement in ms sql server?

739


What is the syntax for encrypting a column in SQL Server?

649


How to use copy and concatenate commands in SQL?

693


How do I create a stored procedure in sql server?

605






What is the difference between locking and multi-versioning?

622


What are the differences between decimal and float in ms sql server?

654


what is denormalization? : Sql server database administration

568


Does table partitioning improve performance?

621


Difference between uniqe index and uniqe constraint?

645


What are the types of subscriptions in SQL Server replication?

630


According to you what goes into making the best database administrator? : sql server database administration

627


What is database white box testing?

759


What is built-in function?

618


What is scalar user-defined function?

636