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

A trigger can reference objects outside the current database? State true or false.

948


Tell me what is the difference between locking and multi-versioning?

973


What is difference in performance between insert top (n) into table and using top with insert?

973


What are the different types of stored procedures?

1069


Can I use sql azure as a backup with log shipping or database mirroring?

156


What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration

943


Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

937


What happens when transaction log is full?

873


How do I edit a procedure in sql server?

900


What is mean by candidate key?

949


where can you add custom error messages to sql server? : Sql server administration

1048


How display code or Text of Stored Procedure using Sql query in Sql Server ?

1070


What is isnull() operator?

979


Do you know what is xpath?

1004


How to create user messages with print statements in ms sql server?

943