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

Difference between report and query parameter. Why do we need different type of parameter?

0 Answers  


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

0 Answers  


What is field with example?

0 Answers  


How to insert new line characters into strings?

0 Answers  


What is change data capture (cdc) in sql server 2008?

0 Answers  






When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?

0 Answers  


Let us say master db itself has no backup. Now you have to rebuild the db so what kind of action do you take?

1 Answers  


What is the use of sign function?

0 Answers  


What is 1nf 2nf?

0 Answers  


What functions can a view be used to performed?

0 Answers  


What is the difference between having clause and where clause in sql server?

0 Answers  


I have cleared sbi clerk examination. I am Bachelor in computer application (BCA) graduate. so which type of question related bca in sbi clerk interviews. pls answers me at sejalvaghela@yahoo.co.in.. and also tell me which type of question asked in sbi clerk interview.

1 Answers  


Categories