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 highest salary from emp table?

Answer Posted / mohammed irfan

SELECT sal1 "salary"
FROM (SELECT ROWNUM rownum1 ,sal1
FROM (SELECT sal sal1
FROM emp
ORDER BY sal DESC
)
)
WHERE rownum1=:p_highest;

Note:- 'p_highest' here we can give the number as we want
to display the highest salary.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sql? : Sql dba

973


What is linq to sql?

1061


What does 0 mean in sql?

914


how many columns can be used for creating index? : Sql dba

899


what is primary key? : Sql dba

958


What is the difference between sum and count in sql?

938


Can we use joins in subquery?

1089


What is blind sql injection?

994


Why function is used in sql?

880


What is a schema? How is it useful in sql servers?

1044


What is the usage of sql functions?

1084


Can we write ddl statements in functions?

1054


Is pl sql and postgresql same?

1059


What is a mutating table and a constraining table?

1038


How much does sqlite cost?

989