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 / ramesh lavanuru

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 ?    52 Yes 63 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a table in a database?

993


Can a trigger call a stored procedure?

1004


Why sql query is slow?

931


how can you create an empty table from an existing table? : Sql dba

1080


write an sql query to find names of employee start with 'a'? : Sql dba

968


What is a relationship and what are they?

1050


Does varchar need length?

933


What is the process of debugging?

1007


Which type of cursor is used to execute the dml statement?

896


Enlist some predefined exceptions?

999


What do you mean by dbms? What are its different types?

953


Can we use the cursor's to create the collection in PL/SQL?

961


How do you concatenate in sql?

975


What is the usage of nvl function?

985


Why is stored procedure faster than query?

909