gpt4 book ai didi

sql - "column ambiguously defined"

转载 作者:行者123 更新时间:2023-12-05 08:59:18 29 4
gpt4 key购买 nike

<分区>

所以我这学期很难理解 SQL。我真的对我在 SQL 方面的知识没有信心,我正在尝试做这个练习,上面写着:

一个 SELECT 语句,用于检索包含列 DEPARTMENT_ID、DEPARTMENT_NAME、FULL_NAME、JOB_TITLE 的员工列表,其中 FULL_NAME 是 First name 和 Last 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:

任何提示和帮助都可以。

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com