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 do you mean by recursive stored procedure?
What is log shipping? Can we do logshipping with SQL Server 7.0 ?
How to delete duplicate rows?
What is a document index?
Explain powershell included in sql server 2008?
Difference between DELETE and TRUNCATE?
Do you know what are acid properties?
Explain iaas, paas and saas?
What are the different methods available under sqlcommand class to access the data?
Do you know what are different types of replication in sql server?
What is the difference between a fill factor of 100 and 0?
What are the benefits and tasks of object explorer? : sql server management studio
What is an index in sql?
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
What is a non-clustered index?