所以这个学期我很难理解 SQL。我真的对我在 SQL 方面的知识没有信心,我正在尝试做这个练习,它说:
用于检索员工列表的 SELECT 语句,DEPARTMENT_ID , DEPARTMENT_NAME , FULL_NAME, JOB_TITLE
其中 FULL_NAME 是名字和姓氏的列,并在它们之间连接一个空格,用于那些他们的职位包含单词“销售”的员工。该列表必须按职位和部门名称排序。
到目前为止,我想出了这个
SELECT department_id,
department_name,
first_name || ' ' || last_name as Full_name,
job_title
FROM departments d, employees e, jobs j
WHERE d.department_id=e.department_id
HAVING job_title LIKE '%Sales%';
错误说:
Error starting at line 1 in command:
select department_id, department_name, first_name || ' ' || last_name as Full_name, job_title
from departments d, employees e, jobs j
where d.department_id=e.department_id
having job_title like '%Sales%'
Error at Command Line:1 Column:8
Error report:
SQL Error: ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
*Cause:
*Action:
任何提示和帮助都可以。