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 are the different Topologies in which Replication can be configured?
What is update_statistics command?
How to download and install sql server 2005 books online?
What are the differences between having and where clause.
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration
What are wait types?
How do I edit a procedure in sql server?
When you should use a low fill factor?
Why do we use sql limitations? Which constraints can we use while making a database in sql?
What is a dbms wizard?
Give an example of why you would want to denormalize a database
Differentiate between delete and truncate.
Create and insert into temp table in sql server?
Explain powershell included in sql server 2008?
What do you mean by acid?