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 |
Can u make a synonym for deptno=10 only from emp table.
what is null value?
Explain a segment?
According to oracle specification VIEW is a object. OBJECT that means anything stored in the oracle database that has the physical existence.why VIEW doesn't take memory in oracle database, but it is treated as a object ?Please explain ?
What are the system predefined user roles?
What is the disadvantage of User defind function?
Explain the use of indexes option in imp command.
What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?
What are joins, explain all types of joins?
How does propagation differ between Advanced Replication and Snapshot Replication (read-only)?
emp numb is unique because that is primary key,,but what is foreign key .. explain very clear with example
How to convert the date format from dd/mm/yyyy to mm/dd/yyyy. (for eg). 22/05/2008 to 05/22/2008. when u use to_char(), it tells the month is invalid. how to resolve this problem.tel with eg.