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 many aggregate functions are available there in sql?
What are the different types of joins in sql?
Write a query to find the names of users that begin with "um" in sql?
What is sql query optimization?
What is procedure function?
Can we rollback after truncate?
What is trigger in pl sql with examples?
What is restrict in sql?
What is sqlerrm?
How do I run a sql script?
can sql servers linked to other servers like oracle? : Sql dba
what are the performance and scalability characteristics of mysql? : Sql dba
how to select first 5 records from a table? : Sql dba
what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba
How do you get column names only for a table (sql server)?