how to find the second highest salary from emp table?

Answer Posted / arjunraj

aa means table-alias name
bb means table-alisa name

select * from emp aa where 2=(select count(distinct empsalary) from emp bb where aa.empsalary<=bb.empsalary)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many joins in sql?

558


What are the basic techniques of indexing?

577


What is difference between left and right outer join?

526


What is the use of prepared statement?

540


Mention what are different methods to trace the pl/sql code?

562






How does one use sql*loader to load images, sound clips and documents? : aql loader

674


How do I run a pl sql program?

629


What are the different operators available in sql?

577


Define tables and fields in a database

646


Explain ttitle and btitle.

674


What are database links used for?

595


What does count (*) mean?

530


What is pl/sql language case sensitive?

635


When you have to use a default "rollback to" savepoint of plvlog?

723


What are records give examples?

566