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
What is nolock?
What is normalization and denormalization in sql server?
How to view existing indexes on an given table using sys.indexes?
How to drop existing views from a database in ms sql server?
How to create stored procedures with parameters in ms sql server?
How to perform backup for certificates in sql server? : sql server security
can any body tell me how to know the password of current user in sql server
How to disable stored procedure sql server?
Which Model uses the SET concept
What is enhanced database mirroring in sql server 2008?
How to assign null values to variables or columns?
How to download and install microsoft .net framework version 2.0?
What can be used instead of trigger?
What is filestream?
What is data modification?