How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / amar banerjee
sol1> select MAX(salary) from emp where salary< (select MAX(salary) from emp);
sol2> select salary from emp sort by salary desc limit 1,1;
for finding nth position
select salary from emp sort by salary desc limit n-1,1;
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What does top operator do?
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
What are views used for?
How can sql injection be stopped? : sql server security
Indexes are updated automatically is the full-text index also updated automatically?
Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?
What are joins in sql and what are the different types of joins?
What is the concept of optimization?
What is sql stored procedure?
How do I view a trc file?
What is dynamic cursor in SQL SERVER?
How column data types are determined in a view?
what is a deadlock? : Sql server database administration
What is merge replication?
What keyword you will use to get schema appended to the result set of a ‘for xml’ query?