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 / eldho k scaria

There are two methods:(Suppose table name is EMPLOYEE,
Colomn name is SALARY, and N=6)

SELECT * FROM EMPLOYEE
WHERE SALARY IN
(SELECT TO 1 SALARY (SELECT DISTINCT TOP 6 SALARY FROM
EMPLOYEE ORDER BY SALARY DESC)
A ORDER BY SALARY)
or
SELECT * FROM EMPLOYEE E1
WHERE (6-1)=(SELECT COUNT (DISTINCT (E2.SALARY))
FROM EMPLOYEE E2
WHERE E2.SALARY>E1.SALARY)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where do you find the default Index fill factor and how to change it?

1017


How many types of schemas are there?

973


How to find the login name linked to a given user name?

945


What stored by the msdb? : sql server database administration

954


in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration

1008


How will you add a dimension to cube? : sql server analysis services, ssas

1013


what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

884


How will you know when statistics on a table are obsolete?

1034


What is logon trigger?

1030


What are the different Authentication modes in SQL Server and how can you change authentication mode?

1022


System variable and temporary variables

2185


Explain index in sql server?

966


Explain microsoft sql server functions?

1036


1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?

2031


Can you always create a cache of a report?

156