Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find the second salary?

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


Please Help Members By Posting Answers For Below Questions

What do you mean by recursive stored procedure?

993


What is log shipping? Can we do logshipping with SQL Server 7.0 ?

1053


How to delete duplicate rows?

1039


What is a document index?

1075


Explain powershell included in sql server 2008?

1117


Difference between DELETE and TRUNCATE?

1097


Do you know what are acid properties?

1123


Explain iaas, paas and saas?

92


What are the different methods available under sqlcommand class to access the data?

1170


Do you know what are different types of replication in sql server?

1156


What is the difference between a fill factor of 100 and 0?

1032


What are the benefits and tasks of object explorer? : sql server management studio

1258


What is an index in sql?

1070


How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?

176


What is a non-clustered index?

1046