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

What are the differences between local and global temporary tables?

1035


How to create an inline table-valued function?

934


How would you go about developing a ssrs report?

164


What the different components in replication and what is their use?

931


Explain “@@rowcount” and “@@error” in sql server?

1026


What is difference between delete & truncate commands?

1046


What are different types of collation sensitivity?

967


Explain the Ways to improve the performance of a sql azure database?

80


What is scheduled job and how to create it?

942


How to create an index on an existing table in ms sql server?

943


How to automatically create a log when an exception is being received into SQL Server?

1235


What are orphan records?

901


Give main differences between "Truncate" and "Delete".

1059


Explain hostprotectionattribute in sql server 2005?

977


What is data compression? : sql server database administration

936