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

How do I change my passwords (database, LDAP, and so on) without causing an outage?

784


How to automatically create a log when an exception is being received into SQL Server?

928


What are the new features of sql server 2012 reporting service?

99


How do you rename a table in sql server?

643


i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1575






How to apply filtering criteria at group level with the having clause in ms sql server?

744


What is a fill factor?

820


What is mean by dml?

734


What is the difference between primary key and unique constraints?

669


What is triggers and its types?

725


Can you name a few encryption mechanisms in sql server?

689


What is merge replication?

862


What is “asynchronous” communication in sql server service broker?

720


Create and insert into temp table in sql server?

779


How many types of the database links?

789