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 command used to recompile the stored procedure at run time?
Distinguish between nested subquery and correlated subquery?
Which are new data types introduced in sql server 2008?
any one can explain Self mapping Delegation Remote Credentials
What is mapping schema?
How are the unique and primary key constraints different?
What is 5nf in normalization form?
What are triggers in ms sql server?
What is the difference between for auto and for nested?
can you any body tell me why are go for the rebuild the master database.what is the reason?
Why do you want to join software field as you have done your BE in Electronics?
What the different components in replication and what is their use?