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 |
2. Display the post code and the total number of purchase orders placed with creditors in that post code.
How to load data through external tables?
What happens to the current transaction if the session is ended?
Can group functions be used in the order by clause in oracle?
How to create a new table in oracle?
how to genarate random numbers in oracle for particular row?
What is the scope of a local variable?
How to get a create statement for an existing table?
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
what are the default admin accounts in Oracle 10g ?
How to revoke create session privilege from a user in oracle?
What is Trigger in Oracle?