write the query for find the top 2 highest salary in sql
server
Answers were Sorted based on User's Feedback
Answer / uday
select * from Emp e where 1=(select count(Distinct
d.esal)from emp d where d.esal>e.esal)
i am sure that it should work.
Any thing wrong plz inform me
Is This Answer Correct ? | 5 Yes | 9 No |
select max(salary)from emp where salary <(select sum(salary)
from emp)
Is This Answer Correct ? | 6 Yes | 12 No |
Answer / santhosh kumar
select Distinct Top 2 Salary from EMP order by Salary desc
Is This Answer Correct ? | 7 Yes | 15 No |
Answer / sivashankar.soma
select ename,sal from emp E where 1=(select count(*) from
emp where E.sal<sal)
Is This Answer Correct ? | 16 Yes | 29 No |
What is the difference between coalesce() & isnull()?
How you can minimize the deadlock situation?
What is function of CUBE ?
what is the difference between delete table and truncate table commands? : Sql server database administration
what is integrated security (SSPI). why we use in the connection string?
Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not accept this command so what do you think you can do in such cases?
How to link tables in sql server?
How do we return a record set from a Stored Procedure in SQl server 2000?
What is the full form of ddl?
What are the advantages of policy management?
Tell me what is the significance of null value and why should we avoid permitting null values?
What is master database? : SQL Server Architecture