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
Explain the difference between cross join and full outer join?
What are different types of raid configurations? : SQL Server Architecture
How to find the second highest salary of an employee?
If a table does not have a unique index, can a cursor be opened on it?
How do I shrink an ldf file?
How do I install only the client tools of sql server 2000?
Mention the different types of triggers?
can we have a nested transaction? : Sql server database administration
What is difference between createstatement and preparedstatement?
Which are the two editions in which SQL Azure database available?
Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...
What is a unique key constraint?
Explain the categories of stored procedure?
What is difference between join and natural join?
What are drillthrough reports?