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
Why Master database is required?
How to attach adventureworkslt physical files to the server?
Write a code to select distinct records without using the DISTINCT keyword.
What are the properties of sub-query?
How to get nth highest salary from employee table.
What is a functions and types in sql server?
When we should use and scope of @@identity?
Why I am getting "the microsoft .net framework 2.0 in not installed" message?
What authentication modes does sql server support?
Explain indexed views and partitioned view with their syntax.
Define cursor locking
What are “unrepeatable reads”?
How to access the deleted record of an event?
What is the fastest way to permanently delete a 1 million row table named customers?
What is indexing explain it with an example?