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
Why do we use procedures in sql?
Why is sql*loader direct path so fast?
Why cross join is used?
what are tables and fields? : Sql dba
What is trigger price?
How do you take the union of two tables in sql?
What is function and procedure in pl sql?
What are sql queries used for?
What is audit logout in sql profiler?
Is json a nosql?
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
What is int identity in sql?
How do I view a sql trace file?
How do I remove sql developer from windows 10?
What is a temp table?