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


Following are some of the question related to below
mentioned query?

select e1.salary from employee3 e1
where 2=
(
select count(distinct(e2.salary))
from employee3 e2 where e2.salary>=e1.salary
)

1) What the query returns?

2) How it works? - Detail explanation (what the sub query
does, why it is (where 2=)....etc...Please?

Answers were Sorted based on User's Feedback



Following are some of the question related to below mentioned query? select e1.salary from empl..

Answer / ashok

Hi

1.Here query will return 2nd highest salary
2.here 2= i.e 2nd heigest similary if we set N in place
of 2 then it will returen Nth heigest salary
where n =1,2,3,4.....

Hope it will help u

Ashok

Is This Answer Correct ?    4 Yes 0 No

Following are some of the question related to below mentioned query? select e1.salary from empl..

Answer / ashok

Hi

1.Here query will return 2nd highest salary
2.here 2= i.e 2nd heigest similary if we set N in place
of 2 then it will returen Nth heigest salary
where n =1,2,3,4.....

Hope it will help u

Ashok

Is This Answer Correct ?    3 Yes 0 No

Following are some of the question related to below mentioned query? select e1.salary from empl..

Answer / suraj

This query does execute, you stupid.
Have some self respect. Do not post comments unless you are
very sure about it.

Is This Answer Correct ?    1 Yes 0 No

Following are some of the question related to below mentioned query? select e1.salary from empl..

Answer / haris

yah this query works fine and return the 2nd highest salary.

Is This Answer Correct ?    0 Yes 0 No

Following are some of the question related to below mentioned query? select e1.salary from empl..

Answer / chintan

First of all this query doesn't execute. I tried it on SQL
2005 and kept getting error.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More SQL Server Interview Questions

How to get a list of columns in a view using the "sp_help" stored procedure?

0 Answers  


What are temporal tables in sql server 2016?

0 Answers  


I have a huge amount of data which is displayed in a report. The data is viewed every day. Every day the data is displayed in 30 secs but suddenly today it is giving an timeout message today. Data has not been changed. The situation is same as yesterday. What might be the reason??? Please Answer.

4 Answers   Satyam,


Why Master database is required?

0 Answers   Abacus,


how to trace the traffic hitting a sql server? : Sql server database administration

0 Answers  


what is the system function to get current user's user id? : Sql server database administration

0 Answers  


explain extended properties

0 Answers  


Explain the architecture of SQL Server?

2 Answers   ABC, HP, Oracle,


Describe about first three Normal forms.

1 Answers   HP,


How to move database physical files in ms sql server?

0 Answers  


explain what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration

0 Answers  


hi, i have a table called names and field name select * from names name a b c d i want to display like this name a,b,c,d how it is possible Regards Baiju

4 Answers  


Categories