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 / sudip mondal
select top 1 from employee where ID in (select top2 ID from
employee order by Salary desc) order by Salary asc
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the meaning of sql server?
How to create a Master database in SQL server ?
What are the acid properties?
Explain what is “asynchronous” communication in sql server service broker?
What is sparse columns of sql server 2008?
How to generate create procedure script on an existing stored procedure?
How do I partition a table in sql server?
Data table as parameter in sql server?
What is the difference between stored procedure and user defined functions?
Where sql server usernames and passwords are stored in a sql server?
What is the importance of three tier architecture?
What is command parameter in ssrs?
If a table does not have a unique index, can a cursor be opened on it?
What do you mean by SQL injection attack?
Explain about SQL server 2005?