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 / ram

select *from emp e where &n in(select count(distinct sal)
from emp m where e.sal<=m.sal);

which will ask's u like :

enter the value for n : 2 (enter 2)
gives u second highest.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is store procedure? How do they work? When do you use?

945


What is difference between stored procedure and user defined function?

1114


Do comments need to go in a special place in sql server 2005?

861


Explain error and transaction handling in sql server?

1018


How can we remove orphan records from a table?

989


Explain what role entity and relationship play in an ER diagram.

1075


Explain trigger and its types?

1070


What is format parameter in ssrs?

146


Define outer join in sql server joins?

939


What's new in sql management studio for sql server? : sql server management studio

1068


How to delete existing triggers using "drop trigger"?

1058


How can I create a report based on a query? : sql server management studio

1018


What is service broker? : sql server database administration

998


What is mssql?

988


Explain error handling in ssis?

1028