how to find nth highest salary

Answer Posted / ramakrishna

select e1.* from emp e1 where n=(select
count(distinct(e2.sal)) from emp e2 where e1.sal<=e2.sal);

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what information is maintained within the msdb database? : Sql server administration

511


How to update values in a table with update statements in ms sql server?

553


What do you understand by physical_only option in dbcc checkdb?

579


I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

601


What is the purpose of self join?

502






Explain Normalization and DE normalization

608


Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio

521


What are the types of resultset?

535


What do you mean by authentication modes in sql server?

611


What is triggers in ms sql server?

640


Can you explain what are various ways to enhance the ssrs report?

583


How to rename databases in ms sql server?

627


1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.

1096


Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration

500


How to create hyperlink from returned sql query ?

625