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?
Answer Posted / 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 |
Post New Answer View All Answers
How do I trace a query in sql server?
What is data source document?
How to set the current database in ms sql server?
What is a dbms wizard?
What are two difference between sql azure and azure tables?
Difference between uniqe index and uniqe constraint?
mention different types of relationships in the dbms?
What are the general features of sql server management studio? : sql server management studio
What is the use of for clause?
Explain various data region available in ssrs with their use?
What is the difference between count and distinct count?
Explain what is lock escalation and what is its purpose?
What is a hint?
What is triggers and its types?
How do I view views in sql server?