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 / p rem satyam

This is perfect
...............................

select * from emp e1 where (N-1)=( select
count(distinct(e2.sal) from emp e2 where e2.sal > e1.sal)

where N is level of sal. suppose you want 3rd higest sal then
in place u write 3 i.e write (3-1).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what's the difference between delete table and truncate table commands? : Sql server database administration

988


Tell me about pre-defined functions of sql?

1112


How will you find out if there are expensive SQL statements running or not?

1017


Explain powershell included in sql server 2008?

1064


what are the new features introduced in sql server 2000? : Sql server database administration

923


How can we migrate from SQL server to SQL Azure?

113


if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration

990


Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?

1401


How sql server enhances scalability of the database system?

1220


Explain the difference between primary keys and foreign keys?

1034


Explain what is lock escalation?

1070


What is a result set object returned by mssql_query()?

1161


What is the security principal at the database level that represents your session?

945


What is Transparent Data Encryption?

1007


How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?

1040