adspace
can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com
Answer Posted / govind.konduri
hai..
select sal from emp where sal=(select max(sal) from
emp where sal<(select max(sal) from emp))
->here,the sub inner query finds the max sal from emp table.
->the main inner query find out the max sal that is less
than the sub inner query max sal.
->the sub query result is sent to outer query..
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Can we do dml on views?
Why should you use or avoid select * statements?
What is self contained sub query?
What are the different SQL Server Versions you have worked on?
What are the kinds of subquery?
Is it possible to have clustered index on separate drive from original table location?
What is sql server query analyzer?
What are wait types?
What is a scheduled job or what is a scheduled task?
Explain system functions or built-in functions? What are different types of system functions?
How to remove duplicate rows from table except one?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
Can you index views?
How do I create a trace in sql server?
How raid can influence database performance?