how to find the second highest salary in a given table????

Answer Posted / manikandan. s

This is the nth max

SELECT salary
FROM (SELECT ROWNUM sl, salary
FROM (SELECT salary
FROM employees
GROUP BY salary
ORDER BY salary))
WHERE sl = n

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to convert .db (extention) database file into .dmp (extention ) for oracle database ?

2058


Explain rename?

548


List out the types of joins.

588


Can you assign multiple query result rows to a variable?

543


What are the attributes of the cursor?

552






What is a schema in oracle?

534


What is difference between truncate and delete?

555


What are the data types in oracle?

548


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1255


What is difference between cartesian join and cross join?

582


How to filter out duplications in the returning rows using oracle?

635


How to use "in out" parameter properly?

610


How to define an oracle cursor variable?

563


How to bring a tablespace offline?

538


What do you mean by a tablespace?

560