使用工具sqldeveloper
請先參考 sqldeveloper下載及安裝及連線
測試資料來源請先參考 Oracle DB 目錄
column ambiguously defined
欄位模棱兩可問題
例:
SELECT employee_id, department_name, department_id FROM employees INNER JOIN departments ON ( employees.department_id = departments.department_id);
錯誤:
ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
其問題:
在 department_id
因為不知道要顯示employees還是departments的department_id
解法:指定來源表格
SELECT employee_id, department_name, employees.department_id FROM employees INNER JOIN departments ON ( employees.department_id = departments.department_id);
測試:
其它文章
沒有留言:
張貼留言