how to find nth highest salary

Answer Posted / seeman

select * from table_name t1 where (n-1)=
(select count(distinct(t2.column_name)) from table_name t2
where t2.column_name>t1.column_name)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is it unwise to create wide clustered index keys?

663


What xml support does the sql server extend?

620


What are constraints in microsoft sql server?

641


What stored by the master? : sql server database administration

653


How is a full-text index updated?

618






What is a result set object returned by odbc_exec()?

626


When columns are added to existing tables, what do they initially contain?

716


How can I create a report based on a query? : sql server management studio

649


What are user defined functions in ms sql server?

588


How to encrypt data between dialogs?

663


What is partition, how will you implement it? : sql server analysis services, ssas

693


What are the indexes in sql server?

595


If user is owning any SQL Objects, can we drop that user

1694


What is sql view?

625


How to generate random numbers with the rand() function in ms sql server?

666