how to get second highest sal of emp table

Answer Posted / anilchandu

Select * from emp x where 2=(select count(distinct sal)
from emp y where x.sal<=y.sal)


where x,y are alias names.

If you want 3rd heighest salary then just replace 2 by 3

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are a query and state the different types of queries and their uses?

732


What is data file?

806


15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.

1987


What is ordinary table in oracle?

826


Which dictionary tables and/or views would you look at to diagnose a locking issue?

1673


What are group functions in oracle?

767


What is using clause and give example?

800


What is a cursor variable?

784


How to convert times to characters in oracle?

798


What is a synonym? What are its various types?

856


how the indexes are stored in the Oracle Database?

1952


Explain enable novalidate constraint.

795


How do I recompile a procedure in oracle?

708


Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.

2064


What is bind variable in oracle 11g?

786