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

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

Where n is no that u want which postion's salary u want
suppose second higest means n=2

Amit

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What triggers long term care?

991


What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?

1020


How to delete a login name in ms sql server?

1003


Can we call future method from queueable?

993


What are the elements of dbms?

919


Explain forward - only cursors?

980


How to change the data type of an existing column with "alter table" statements in ms sql server?

930


How many replicas are maintained for each sql azure db?

122


What is Lock table in SQL?

1409


How would we use distinct statement? What is its use?

1022


What are the advantages of sql stored procedure?

1014


Where is localdb stored?

887


What will be query used to get the list of triggers in a database?

953


What is cursors?

1094


What are the recovery models for a database?

1056