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
What is resource db in sql server?
How to encrypt data between dialogs?
What is trigger in salesforce?
Can you roll back the ddl statement in a trigger?
Explain few examples of stored procedure over triggers?
Does partitioning ssd reduce performance?
How to connect a database with sql express.?
Describe how to use the linked server?
What are the two authentication modes in sql server?
What does asynchronous call backs means?
What is the difference between dbcc indexdefrag and dbcc reindex?
What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas
Explain the creation and execution of a user-defined function in the sql server?
What are the different types of replication you can set up in sql server?
What is TDS(Tabular Data Stream) Gateway?