How to find 1st, 2nd, 3rd highest using select select
statement not using rownum

Answer Posted / madhavi

SELECT sal
FROM (SELECT sal, RANK() OVER(ORDER BY sal DESC) AS rnk
FROM emp)
WHERE rnk IN (1,2,3);

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is private procedure oracle?

529


IS it possible to built the oracle database without setting the kernal parameters?

1762


Explain the use of rows option in exp command.

585


Point the difference between translate and replace?

572


What is the difference between postgresql and oracle?

505






Describe an oracle table?

574


Query to retrieve record for a many to many relationship ?

2079


How translate command is different from replace?

546


What is meant by a deadlock situation?

577


What are the differences between primary key and unique key?

515


How do you get nicely formatted results from an oracle procedure that returns a reference cursor?

554


Can we convert a date to char in oracle and if so, what would be the syntax?

549


Can group functions be mixed with non-group selection fields?

534


What is set verify off in oracle?

577


while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511

3871