Answer Posted / srinu
Hi Jyothi,
The below q uery is suitable for Nth max salary....
SELECT a.sal
FROM emp a
WHERE &N=(SELECT COUNT(DISTINCT b.sal)
FROM emp b
WHERE a.sal<=b.sal);
In the above query u can substitute any value like 1,2,..100 etc instead of &n.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How can one get sql*loader to commit only at the end of the load file? : aql loader
What are the parts of a sql statement?
What does rownum mean in sql?
What is lookup table in sql?
what are different types of collation sensitivity? : Sql dba
What are the different types of triggers?
Why is a primary key important?
What is a sql select statement?
Do we need to rebuild index after truncate?
How many sql statements are used? Define them.
how to include numeric values in sql statements? : Sql dba
What is the use of nvl function?
How is debugging done?
List out the acid properties and explain?
Why do we use set serveroutput on?