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 purpose of forms?
how can u select the Distinct values in the table, table having 20 columns , i want all columns
What is the difference between a local and a global variable?
Explain multiserver query
what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration
How to test odbc dsn connection settings?
What is the maximum size of column in sql server?
Explain the ways to controlling cursor behavior?
What is 2nf normalization?
what is meant by deafult in sql server?
What are the two types of concurrency?
What is log shipping?