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 can you attach more than 20 ldf files in sql server
What is buffer cash and log cache in sql server?
Does transparent data encryption provide encryption when transmitting data across the network?
Define ACID properties in a Database?
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.
how to create a scrollable cursor with the scroll option? : Sql server database administration
When multiple after triggers are attached to sql table, how to control the order of execution?
What is a heap?
How to locate and take substrings with charindex() and substring() functions?
A user is a member of the public role and the sales role. The public role has select permission on all the tables. The sales role does not have select permission on some of the tables will the user be able to select from all tables?
What are the requirements to use odbc connections in php scripts?
Why use sub query in sql server and list out types of sub queries?
What are the disadvantages of primary key and foreign key in SQL?
How do I view a trc file?
What are the different types of collation sensitivity?