Oracle SQL having 子查詢 sub Query
使用工具sqldeveloper
請先參考 sqldeveloper下載及安裝及連線
測試資料來源請先參考 Oracle DB 目錄
關鍵詞(keyword): having (select語句)
having 子查詢 sub Query
將select語句當做having 的條件
例:
使用departments 部門表格
簡單測試語法:
SELECT
department_id,
max(salary)
FROM employees
group by department_id
having department_id > (
select department_id from departments where DEPARTMENT_ID=50
)
測試:
其它文章
留言列表