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 the query for find the top 2 highest salary in sql
server

Answers were Sorted based on User's Feedback



write the query for find the top 2 highest salary in sql server..

Answer / kapil singh chauhan

select * from
(select ID,Salary from employee order by Salary desc)
where rownum < 3

Is This Answer Correct ?    4 Yes 3 No

write the query for find the top 2 highest salary in sql server..

Answer / karan

select empname,sal from empdpt e where 1=(select count(*) from
empdpt where e.sal<sal)

Is This Answer Correct ?    3 Yes 2 No

write the query for find the top 2 highest salary in sql server..

Answer / nilesh

select * from employee2 e where 2=(select count(distinct salary) from employee2
where e.salary<=salary)

Its working.

Is This Answer Correct ?    2 Yes 1 No

write the query for find the top 2 highest salary in sql server..

Answer / ramu

select * from emp e where 2=(select count(sal) from emp
where e.sal<=sal)

Is This Answer Correct ?    6 Yes 6 No

write the query for find the top 2 highest salary in sql server..

Answer / saurabh

Answer 24 is correct , i have checked it.

Is This Answer Correct ?    0 Yes 0 No

write the query for find the top 2 highest salary in sql server..

Answer / mohan c v

select min(salary) from
(select top 2 salary from emp order by salary desc) as a

Is This Answer Correct ?    0 Yes 0 No

write the query for find the top 2 highest salary in sql server..

Answer / priyanka

select salary from emp where rowno=3 order by sal desc.

but this query works only when you have to create index.

Is This Answer Correct ?    0 Yes 0 No

write the query for find the top 2 highest salary in sql server..

Answer / ravi pahuja

selecl distinct top 2 salories from emp order by salory desc

Is This Answer Correct ?    0 Yes 0 No

write the query for find the top 2 highest salary in sql server..

Answer / girish

select max(salary) from emp where sal<(select max(salary)
from emp

Is This Answer Correct ?    0 Yes 0 No

write the query for find the top 2 highest salary in sql server..

Answer / chandan kumar

Select Top 1 salary from(select top 2 salary from emp_table
order by salary asc)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

what is create database syntax? : Sql server database administration

0 Answers  


What is a mutating table error and how can you get around it?

0 Answers  


What is the use of builtinadministrators group in sql server? : sql server security

0 Answers  


What is the concept of optimization?

0 Answers  


Explain what is the main purpose of having conversation group?

0 Answers  


What is a functions and types in sql server?

0 Answers  


What is the recommended total size of your memory optimized tables?

0 Answers  


Can you explain the role of each service?

1 Answers  


What are different backups available in sql server?

0 Answers  


How to use “drop” keyword in sql server and give an example?

0 Answers  


How to count rows with the count(*) function in ms sql server?

0 Answers  


What are the steps you will take to improve the performance of a poor performing query?

0 Answers  


Categories