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 transaction server isolation?
How many types of built in functions are there in sql server 2012?
Can we add our custom code in ssis?
Which database stores information about replication?
Does index speed up select statements?
What are the different types of indexes?
Please give me the SP for the below scenario. I have two tables named Table1 and Table2...I need to fetch record by record from Table1 and insert the record in to table2 where the value in the sno column of the table1 is even number.
What are data resources?
What is auditing in sql server?
Explain what is sql server english query?
Which data type columns are the best candidates for full-text indexing?
What is row by row processing ?
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)