Answer Posted / vishnu
Here we can find out 2nd highest salary in many ways,
according to the situation we can select anyone…
1st Type:
select min(esal) from emp where esal in (select top 2 esal
from emp order by esal desc)
2nd Type:
select max(esal) from emp where esal not in(select max(esal)
from emp)
3rd Type:
select max(esal) from emp where esal <(select max(esal) from
emp )
4th Type:
select Max(esal) from EMP a where 2=(select
COUNT(distinct(esal)) from EMP b where a.eSAL<=b.eSAL);
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
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?
how to create “alternate row colour”?
How to update multiple rows with one update statement in ms sql server?
Explain what are commit and rollback in sql?
What is row_number function?
What is use of attribute hierarchy ordered ? : sql server analysis services, ssas
Define inner join? Explain with an example?
What is store procedure? How do they work? When do you use?
How to configure and test odbc dsn settings?
How do I debug a stored procedure in sql server?
List out the differences between the clustered index and non-clustered index in sql server?
What is the difference between resultset and resultsetmetadata?
What is ems sql management studio? : sql server management studio
What is the difference between an index and a unique index?
Tell me about normalization in DBMS.