Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / vishakha shrivastava

for second largest salary
Select * from emp a where 2=(select count(*) from emp b
where a.sal<=b.sal)

Above mentioned query can also be used for 3 ,4 ..n

Select * from emp a where 3=(select count(*) from emp b
where a.sal<=b.sal)

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the disadvantages of indexes?

1090


What is after dml trigger?

1022


Explain what are the events recorded in a transaction log?

1007


Tell me what is the order in which the sql query is executed?

956


Explain transaction server distributed transaction?

984


Can sql server 2016 run on windows 7?

923


How many types of triggers are there?

1068


Difference between Sql server reporting services and Crystal reports?

172


How you can add messages to the nt event log from within a stored procedure?

1070


What is the difference between varchar and nvarchar?

943


Why do we use stored procedures in sql server?

947


How much memory that we are using in Logshipping Concept?

1798


Why do we use sql limitations? Which constraints can we use while making a database in sql?

1080


how you can list all the tables in a database?

1027


What are the purposes of floor and sign functions?

979