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 / bhagya
select * from emp as e1 where 1= (select count(*)from emp
as e2 where e1.sal<e2.sal)
| Is This Answer Correct ? | 9 Yes | 11 No |
Post New Answer View All Answers
What are the reporting services components?
How to run queries with sql server management studio express?
What is the use of sql profiler in sql server 2012?
How can I know what locks are running on which resource?
Explain the properties of a relational table?
How can you list all the columns in a database?
How to resolve the orphan use problem? : sql server security
How to generate create function script on an existing function?
What are the differences between ms sql server & oracle?
What is the stuff and how does it differ from the replace function?
Can we add our custom code in ssis?
What is database black box testing?
Explain Geography datatype in SQL Server
What is forward - only cursors / read only cursor?
What is cdc in sql server?