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 is dknf in normalization form?
Is foreign key unique?
What specific conditions database should meet, before you can bulk copy data into it using bcp?
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
What is difference between drop truncate and delete?
Is foreign key a primary key?
What are a scheduled jobs or what is a scheduled tasks?
Explain the commands in sql server?
Can a rule be bound to any column of any data type?
what is the maximum size of a row? : Sql server database administration
How to transfer a table from one schema to another?
what is a self join? : Sql server database administration
How to use “drop” keyword in sql server and give an example?
Explain logical operators in sql server?
Difference between Logical Page and Physical Page in SSRS.