how to find nth highest salary

Answer Posted / deepak dabi

I Think this is the best solution ever i have seen ,i
appriciate if you prove me wroong on this so,otherwise i got
all other a bit wrong ,in many cases please try this....



"SELECT distinct(sal) from emp order by sal desc limit 2,1"

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to provide column names in insert statements in ms sql server?

714


What is difference between after and before?

597


Tell me what is normalization? Explain different forms of normalization?

650


Can an automatic recovery be initiated by a user?

657


Where can you add custom error messages to sql server?

666






How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?

644


What is use of attributehierarchyenabled? : sql server analysis services, ssas

697


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

3898


Can sql server 2016 run on windows 7?

593


What is the difference between local and global temporary tables?

682


What is the difference between dataadapter and datareader?

617


How to rebuild the master database?

679


How do I find the default sql server instance?

610


How do you clear a log file?

609


What are the different types of sub-queries?

684