close

Oracle SQL where all 子查詢 sub Query

使用工具sqldeveloper
  請先參考 sqldeveloper下載及安裝及連線

測試資料來源請先參考 Oracle DB 目錄


關鍵詞(keyword): where  all  (select語句)
where  all  子查詢 sub Query
將select語句當做條件


例:

使用departments 部門表格

SELECT
employee_id,
last_name,
salary
FROM employees
WHERE salary >= all(
select MAX(salary)
from employees
)
ORDER BY employee_id;

測試:





 

 







其它文章

arrow
arrow

    PG Levin Li 發表在 痞客邦 留言(0) 人氣()