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 / g

TO FIND THE 3rd,

select max(sal) from emptable where salary not in(select
distinct top 2 sal from emptable)

TO FIND THE 4th,

select max(sal) from emptable where salary not in(select
distinct top 3 sal from emptable)

TO FIND THE 5th,

select max(sal) from emptable where salary not in(select
distinct top 4 sal from emptable)

keep change top value...

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you pass expressions to function parameters?

1154


Explain what is meant by replication of database?

1106


What is default port number for sql server 2000?

1106


Is oracle faster than sql server?

1008


How to create a view with data from multiple tables?

1064


How many columns can exist together per table?

1210


Do you know what are the restrictions that views have to follow?

1128


What does set rowcount do?

961


What is the use of =,==,=== operators?

1058


How can you insert null values in a column while inserting the data?

1343


How to optimize stored procedure optimization?

966


What is acid mean in sql server?

1200


What is raiseerror? What is raiseerror?

1193


Difference between primary key and clustered index?

1064


How can delete duplicate records in cte in sql server?

1017