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


Please Help Members By Posting Answers For Below Questions

Explain the difference between cross join and full outer join?

482


What are different types of raid configurations? : SQL Server Architecture

562


How to find the second highest salary of an employee?

574


If a table does not have a unique index, can a cursor be opened on it?

509


How do I shrink an ldf file?

546






How do I install only the client tools of sql server 2000?

537


Mention the different types of triggers?

535


can we have a nested transaction? : Sql server database administration

490


What is difference between createstatement and preparedstatement?

527


Which are the two editions in which SQL Azure database available?

97


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 ...

1562


What is a unique key constraint?

517


Explain the categories of stored procedure?

506


What is difference between join and natural join?

467


What are drillthrough reports?

100