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 |
Describe how to use the linked server?
What is the difference between a local and a global temporary table?
What is xdr?
How to delete duplicate rows in sql server?
What are the types of sql server?
Where the sql logs gets stored?
What is a join and their types?
2 Answers Challenger Financial,
what is a self join? : Sql server database administration
Tell me what do we need queues in sql service broker?
What is set nocount on?
what is package configuration variable?How to change file name in folder dynamically?Plz help me
How to use “drop” keyword in sql server and give an example?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)