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

Answers were Sorted based on User's Feedback



write query for fourth maximum salary from employee table..

Answer / anish tuladhar

select
distinct salary
from
(
select
DENSE_RANK() over(order by salary desc) as rnk,
salary
from
employee
) a
where
rnk = 4

Is This Answer Correct ?    0 Yes 0 No

write query for fourth maximum salary from employee table..

Answer / prabhjeet singh sethi

select * from
(select rank(salary) over (partition by employee order by salary desc) as top_salary, employee from table
group by employee)
where top_salary = 4

Is This Answer Correct ?    0 Yes 0 No

write query for fourth maximum salary from employee table..

Answer / icedrop

 select top 1 salary from (select distinct top 4 Salary from tablename order by salary desc ) result order by salary 

Is This Answer Correct ?    0 Yes 0 No

write query for fourth maximum salary from employee table..

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

More SQL Server Interview Questions

How to delete duplicate records based on single column from a table?

0 Answers   Petranics Solutions,


How do I shrink an ldf file?

0 Answers  


What is difference between inner join and join?

0 Answers  


What do you understand by a view?

0 Answers  


What does it mean to manipulate data?

0 Answers  


how can you move the master database

1 Answers   IBM,


What new changes are being made in SQL Server?

0 Answers   Blue Star,


What are the differences between substr and charindex in sql server.

0 Answers  


How to create a user name in a database?

0 Answers  


Explain about merge replications?

0 Answers  


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

0 Answers  


How many types of the database links?

0 Answers   MCN Solutions,


Categories