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 / radhakrishnan vaithilingam
SELECT TOP 1 id.salary
FROM (SELECT TOP 2 id,salary
FROM employee
ORDER BY salary DESC )a
ORDER BY a.salary ASC
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do indexes help, types?
What extended events?
What is log ldf?
Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?
what is a check constraint?
How to receive output values from stored procedures?
Does any body please help me what question's have asked for SSRS in the interview?
What is difference between joins and subqueries?
Which sql server table is used to hold the stored procedure scripts?
Explain foreign key in sql server?
What is serializable?
What is instead of dml trigger?
Which autogrowth database setting is good?
How to read data in a table with "select" statements?
Can We Use Data-grids For Our Report In Ssrs?