我想写一个查询来显示获得前 3 名薪水的员工
SELECT *
FROM (SELECT salary, first_name
FROM employees
ORDER BY salary desc)
WHERE rownum <= 3;
但我不明白这个 rownum 是如何计算嵌套查询的,如果它有问题,请让我理解:
SELECT *
FROM (SELECT salary, first_name
FROM employees
ORDER BY salary )
WHERE rownum >= 3;
我浏览了这个链接Oracle/SQL: Why does query "SELECT * FROM records WHERE rownum >= 5 AND rownum <= 10" - return zero rows,但它再次指向一个链接,它没有给出答案