I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000
Answer Posted / lekhrajdeshmukh
select top 1 id,salary from(select top 2 id,salary from
employee group by id,salary order by salary desc)a order by
salary asc
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What happens if an integer is too big for int date type?
Why SQL Agent is used?
What is meant by indexing files?
What is database white box testing?
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
How dts is used to extract, transform and consolidate data?
What is the impact on other user sessions when creating indexes?
What is a dbms wizard?
What is rs.exe utility?
What are the ways available in sql server to execute sql statements?
What is view in sql?
You are designing a database for your human resources department in the employee table, there is a field for social security number, which cannot contain null values if no value is given, you want a value of unknown to be inserted in this field what is the best approach?
What is trigger in salesforce?
What is the maximum size of sql server database?
What is the difference between clustered index and primary key?