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...

To find second largest salary in Employee table

Answer Posted / v rajkumar

Select min(salary)FROM emp WHERE salary IN (SELECT distinct
TOP 2 salary FROM emp ORDER BY salary desc)
OR
Select top 1 salary from (select distinct top 2 salary from
emp order by salary desc) emp order by salary

OR
select max(salary) from emp where salary <(select max
(salary) from emp)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a cursor be updated? If yes, how you can protect which columns are updated?

1115


If a table does not have a unique index, can a cursor be opened on it?

916


What is system stored procedures?

1048


what is database replicaion? : Sql server database administration

1203


Explain log shipping?

1028


Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?

1068


what is package and it uses and how can u call a package

2017


What happens if you are trying to access a schema not owned by you?

969


Can you force a query to use a specific index?

950


How to check status of stored procedure in sql server?

990


Explain the etl (extraction, transformation, and loading)?

1002


How do I view a script in sql server?

1047


What command is used to create a database in the sql server and how?

1186


How many cores do I need for sql server 2016?

905


What do you understand by sql server agent?

980