write the query for find the top 2 highest salary in sql
server
Answer Posted / nilesh
select * from employee2 e where 2=(select count(distinct salary) from employee2
where e.salary<=salary)
Its working.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the difference between update lock and exclusive lock?
How to replace given values with null using nullif()?
Can two tables share the same primary key?
What is a fan-out query in SQL Azure?
What is SQL Server?
What is implicit cursors?
How to transfer data from a cursor to variables with a "fetch" statement?
How many cores do I need for sql server 2016?
What is optimization and its types?
Tell me what is difference between clustered and non clustered index?
How to add a new column to an existing table with "alter table ... Add" in ms sql server?
How will you know when statistics on a table are obsolete?
How data can be copied from one table to another table?
How to list all schemas in a database?
What is always encrypted?