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

logshipping is Any difference 2000 and 2005?

2 Answers  


What is user stored procedure & it purpose?

4 Answers   Wipro,


What are the parts of a function?

0 Answers  


Diffrences between sql server 2000 vs 2008

0 Answers   TCS,


How many types of database relationship in sql server?

0 Answers  


If i am handling 150 servers then how to check the active jobs of all the servers?

0 Answers  


What are the purposes of floor and sign functions?

0 Answers  


What is side by side migration in sql server?

0 Answers  


What is the use of RDBMS?

0 Answers   Wipro,


1.what is the purpose of using alias name in sql server? with certain example? 2.what is cursor?will u plz explain me in detail with certain example?

3 Answers  


Wht is the difference between stored procedure and trigger

6 Answers   HCL, TCS,


plz tell me the new features of sqlserver2000,sqlserver2002,sqlserver2005

3 Answers  


Categories