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 ? | 4 Yes | 0 No |
Post New Answer View All Answers
How you would rewrite the sql query to return the customerid sorted numerically?
Which language rdl files made of?
What are the triggers in sql?
What is subquery in sql?
What do you understand by replication in sql server? Mention the different types of replication in sql server.
What is the largest component inside a field?
What is Extended user-defined?
Explain time data type in sal server 2008?
How do I open port 1433?
What are extended events in sql server?
What is the difference between mysql and sql server?
How adventureworkslt tables are related?
Determine how to use the inserted and deleted pseudo tables?
what is a schema in sql server 2005? : Sql server database administration
How to end a stored procedure properly in ms sql server?