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

Why we are using the sql language?. What is the purpose of using this?

2 Answers  


Why use triggers?

0 Answers  


List the advantages of using stored procedures?

0 Answers  


Explain about merge replications?

0 Answers  


What is triggers and stored procedures?

0 Answers  


How can we delete Duplicate row in table?

0 Answers   Wipro,


How to connect to a sql server using odbc_connect()?

0 Answers  


what purpose does the model database serve? : Sql server database administration

0 Answers  


What command is used to rename the database?

0 Answers  


What is the default server name for sql server?

0 Answers  


What are the different types of backups avaialabe in sql server 2005?

0 Answers  


What are the new features in sql server 2016?

0 Answers  


Categories