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 nth highest salary

Answer Posted / bharath

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

replace 3 by 2 for second highest...

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the server name in sql server?

1069


What are indexes in ms sql server?

1120


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

1139


Explain primary key and foreign key constraints?

1093


Is foreign key unique?

1049


What is a sql join?

1082


What are examples of triggers?

1127


What is difference between oltp and olap?

1095


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

2085


What is dynamic cursor in SQL SERVER?

1141


How to create a view on an existing table in ms sql server?

1194


What is conditional split?

1141


How to receive returning result from a query?

1193


What will happen if a column containing char type data is changed to the nchar data type?

1154


How to Insert multiple rows with a single insert statement?

1102