Monday 5 November 2012

How to get the five highest-paid people—a top- N query

SELECT *
  FROM (SELECT *
            FROM emp
        ORDER BY sal DESC)
 WHERE ROWNUM <= 5;

No comments:

Post a Comment