How to display 4th maximum sal in enp without using subqueries?

Showing Answers 1 - 8 of 8 Answers

Soumya Ranjan Pradhan

  • May 13th, 2007
 

The right answer for this out put is
   

SELECT LEVEL, MAX(colname)
FROM tablename
WHERE LEVEL = &LevelNo
CONNECT BY PRIOR colname > colname
GROUP BY LEVEL
/


Ans------

SELECT LEVEL, MAX(Sal)
FROM Emp
WHERE LEVEL = &LevelNo
CONNECT BY PRIOR Sal > Sal
GROUP BY LEVEL
/


  Was this answer useful?  Yes

vaibhav Tyagi

  • Sep 25th, 2007
 

select max([columnName]-4) from tableName

  Was this answer useful?  Yes

Shiyamala Devi

  • Jan 5th, 2012
 

Code
  1.  SELECT *

  2.         FROM (SELECT player_nm, gross_sal,

  3.                RANK () OVER (ORDER BY gross_sal DESC) playerRank

  4.               FROM player)

  5.         WHERE playerRank = 4;


This query will display 4th highest salary from the player table

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions