how to select second mauximum value in a given table under salary column
Answers were Sorted based on User's Feedback
Answer / jai
SELECT MAX(SALARY) FROM EMPLOYEE
WHERE SALARY NOT IN(SELECT MAX(SALARY) FROM EMPLOYEE)
| Is This Answer Correct ? | 27 Yes | 2 No |
Answer / sonthosh
SELECT * FROM
(
SELECT
NAME
,SALARY
,RANK() OVER (order by salary desc) RANK
FROM EMPLOYEE)
WHERE RANK = 2
| Is This Answer Correct ? | 7 Yes | 4 No |
Answer / utkal
Select distinct(E1.Salary) from EMPLOYEE E1 where 2 =
(Select Count(distinct(E2.Salary)) from Employe E2 where
E1.Salary <= E2.Salary).
Here n=2,
Similarily we can find the 5th highest salary etc...
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / u.radha
SELECT * FROM (SELECT ENAME,SAL,DENSE_RANK() OVER(ORDER BY SAL DESC) RN FROM EMP) WHERE RN = 2;
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / shri
select min(sal) from (select * from emp order by sal desc) where rownum<3
IN Informatica also use the query in source qualifier's
"sql override". which will reduce d no. of t/r in d mapping
| Is This Answer Correct ? | 3 Yes | 3 No |
which sql command we can use to get a print out from oracle?
Whatz the main diff between Subquery and a Join
14 Answers Oracle, Zeta Interactive,
What is pragma restrict_reference in oracle 9i?When we use this?Give me one realtime scenario?
how to handle exceptions in post production
A VIEWS takes memory in the database. If yes, how can u proove it? is there any way to display the size of views?
What is a database schema in oracle?
defination of bitmap index
List the parts of a database trigger.
What is meant by raw datatype?
What is the effect of setting the value of OPTIMIZER_MODE to 'RULE' ?
What are nested tables?
Explain user account with reference to oracle.