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 does the INSTEAD OF trigger do?
How global temporary tables are represented and its scope?
What is a cursor, index in sql?
what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration
What are the High-Availability solutions in SQL Server and differentiate them briefly?
Ek lifafa 10 noto se bhara hai usme 2 or 5 ke note nahi hai aur usme total 50Rs hai, to batao lifafe me kon se not kitne hia it’s a challenge thank’s
How to list all tables in the database using odbc_tables()?
What is a transactions?
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
What is tabulation?
If we delete pack Spec what will be the status of pack Body ?
Explain the database you used in your final year project?
Oracle (3259)
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)