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 / haris

yah this query works fine and return the 2nd highest salary.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of replication in sql server?

743


Explain the difference between functions and stored procedures in sql server?

672


What authentication modes does sql server support?

752


Can you explain various data region available in ssrs with their use?

720


What is 3nf normalization form?

757






How to create a simple user defined function in ms sql server?

738


Explain error handling in ssis?

750


What is the purpose of a table?

721


How important do you consider cursors or while loops for a transactional database?

702


You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?

833


How to use old values to define new values in update statements in ms sql server?

866


How can you start sql server in different modes?

709


How do use Having,Group by,Group function in SQL?

1533


What is multi-statement table-value user-defined function?

720


How should i optimize the time for execution of stored procedure having single input and many output from the different tables?

1654