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

How can we rewrite sub-queries into simple select statements or with joins?

984


What are blobs, tables, and Queues? Is SQL is the standard way to query blobs, tables, and queues?

137


What is an expression in ms sql server?

1084


how to control the amount of free space in your index pages? : Sql server database administration

1045


What is self join in sql server joins?

1067


What is the use of stored procedure?

943


What is resource governor in sql server?

1008


Why variables called the most powerful component of ssis?

1083


What type of locking occurs during the snapshot generation? : sql server replication

1338


What do you understand by check constraint in sql server?

950


Explain the difference between HTTP and HTTPS in database?

1040


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

2039


How to get the definition of a trigger back?

1003


What is a cube? : sql server analysis services, ssas

1004


What are different types of database indexes?

1105