write the query for find the top 2 highest salary in sql
server

Answer Posted / srinivas

select e1.sal from emp e1 where 2=(select count(distnct
(e2.sal) from emp e2 where e2.sal>=e1.sal)

Is This Answer Correct ?    33 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When would you prefer to have a minimum number of indexes?

657


What are the types of joins in sql?

776


Differentiate between truncate vs delete in mssql?

684


Explain the difference between primary keys and foreign keys?

697


wat wil hapn if we give the both read and deny read permission to user?

1864






What are the different types of sub-queries?

765


Does sql server use java?

729


How to use values from other tables in update statements in ms sql server?

742


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

4013


What is a view and what are its advantages?

855


What is extended stored procedures?

718


In which tcp/ip port does sql server run? Can it be changed?

721


Explain SSRS Architecture?

163


Is mysql better than sql server?

734


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

772