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

What are blobs, tables, and Queues? Is SQL is the standard way to query blobs, tables, and queues?

114


how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

1187


What is user-defined inline table-valued function?

499


What is the use of floor function in sql server?

515


Name 3 ways to get an accurate count of the number of records in a table?

549






How to retrieve field values using mssql_result()?

610


Can I disable or restrict ssrs export formats (rendering formats)?

102


how can you attach more than 20 ldf files in sql server

1549


How to verify the port number of the sql server?

530


How to check what was the last restore transaction LSN in Log shipping or Mirroring? when we don't have a Monitor or witness server.

3355


Explain how to use linked server?

534


Describe in brief databases and sql server databases architecture.

509


Define full outer join in sql server joins?

479


What do you understand by replication in sql server? Mention the different types of replication in sql server.

490


How check triggers in sql server?

499