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 |
Can we create trigger on view in oracle?
what is the exact diiference between DBMS and RDBMS
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 ?
what are bitmap indexes? How does they work?
What is oracle and what are its different editions?
How do I spool to a csv formatted file using sqlplus?
How to convert characters to dates in oracle?
What would you do if a database crashes in production?
How to select the name of employee who is getting maximum sal with out using subquery
Can sub procedure/function be called recursively?
What is Private Database Link ?