how to find the second highest salary in a given table????
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
Write a simple Store procedure and pass parameter to it ?
How to use group functions in the select clause using oracle?
What is the difference between a hot backup and a cold backup in oracle?
What is tablespace in oracle? how can we create? how is it manage? . . . Thnx 2 All in Advnc....:)
What is execute immediate in oracle?
17. Display the order number and average item cost for each order.
Explain the use of grant option in exp command.
What do database buffers contain?
Will the Optimizer always use COST-based approach if OPTIMIZER_MODE is set to "Cost"?
I know that i can create a table without a primary key.But is there any significance for that table???? while creating an application.
What is recovery manager(rman) backup in Oracle?
Explain integrity constraint?