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 / saikrishna reddy .k

To find second highest salary
select max(sal) from emp where sal not in (select max(sal)
from emp)

to find order
select top 5 8 from emp order by sal desc

Is This Answer Correct ?    30 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

533


What are the requirements on sql server network connections?

523


Can a rule be bound to any column of any data type?

566


How can you list all the table constraints in a database?

513


What is the difference between a fill factor of 100 and 0?

534






What is cte (common table expression)?

601


What is the difference between count () and rowcount ()?

523


How to see existing views in ms sql server?

546


What is the difference between DATETIME2 and DATETIME?

631


What is command parameter in ssrs?

120


What are the events recorded in a transaction log?

508


How do you know if sql server is running on your local system?

542


Do you know the cursor optimization tips?

588


Does union all remove duplicates?

611


What is difference between cte and view?

526