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 in a given table????

Answers were Sorted based on User's Feedback



how to find the second highest salary in a given table????..

Answer / kedar

select max(salary) from employees where salary < (select
max(salary) from employees);


the max salary is 24000
& second max is 17000
chwck out

Is This Answer Correct ?    8 Yes 0 No

how to find the second highest salary in a given table????..

Answer / shahnaz

To find the 2nd highest salary from emp table:

select max(sal) from emp where sal not in (select max(sal)
from emp )

Is This Answer Correct ?    3 Yes 2 No

how to find the second highest salary in a given table????..

Answer / manikandan. s

This is the nth max

SELECT salary
FROM (SELECT ROWNUM sl, salary
FROM (SELECT salary
FROM employees
GROUP BY salary
ORDER BY salary))
WHERE sl = n

Is This Answer Correct ?    1 Yes 1 No

how to find the second highest salary in a given table????..

Answer / mahesh

SELECT *
FROM (SELECT ROWNUM sl, salary
FROM (SELECT DISTINCT salary
FROM employees
ORDER BY salary))
WHERE sl = n

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary in a given table????..

Answer / ajit nayak

SELECT MAX( Sal ), LEVEL
FROM Emp
WHERE LEVEl = &Givelevelno
CONNECT BY PRIOR Sal > Sal
GROUP BY LEVEL;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

Can we create trigger on view in oracle?

1 Answers  


what is the exact diiference between DBMS and RDBMS

4 Answers   Tesco,


how many outer joins are used in a single sql query? is there any limitations for using of outer joins?

2 Answers   BOB Technologies, Cap Gemini, IBM,


What is Parallel Server ?

3 Answers  


what are bitmap indexes? How does they work?

0 Answers  


What is oracle and what are its different editions?

0 Answers  


How do I spool to a csv formatted file using sqlplus?

0 Answers  


How to convert characters to dates in oracle?

0 Answers  


What would you do if a database crashes in production?

1 Answers  


How to select the name of employee who is getting maximum sal with out using subquery

15 Answers  


Can sub procedure/function be called recursively?

0 Answers  


What is Private Database Link ?

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)