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...

write query for fourth maximum salary from employee table

Answer Posted / santhosh

;with result as
(
--use dense_rank instead of row_number or rank
select salary, DENSE_RANK() over (order by salary desc) as denserank
from Employees
)
select top 1 * from result
where denserank = 4

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain different types of lock modes in sql server 2000?

984


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

1028


how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

1728


what are defaults? : Sql server database administration

1163


Where actually sql azure database is hosted?

167


What are audit control procedures?

1034


Explain the various types of concurrency problem?

1241


Explain security with sql azure?

186


What is a constant or literal in ms sql server?

1098


Where the sql logs gets stored?

1035


How many types of triggers in sql server?

1090


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

1005


What are the different normalization forms?

1164


Why should one not prefix user stored procedures with ‘sp_’?

1099


What stored by the tempdb ? : sql server database administration

1098