gpt4 book ai didi

sql - oracle sql开发人员: 00904. 00000- "%s: invalid identifier"。我的错在哪里

转载 作者:行者123 更新时间:2023-12-04 08:08:22 32 4
gpt4 key购买 nike

我正在尝试找出我的错。
我收到此错误消息:

SQL-Fehler: ORA-00904: "S1"."PARTNO": ungültiger Bezeichner 00904. 00000 - "%s: invalid identifier"



我已经检查了数据库,所有表都存在。

这是我的SQL代码:
select s1.*
, p.city as "Produktionsort"
, p.partname
from (select count(s.partno) as "Anzahl_Produktarten"
, s.partno as "Partno"
from company.supp_part_job s
group by s.partno ) s1
, company.part p
where s1.partno IN (select p1.partno from company.part p1 where p1.city != 'London')
and p.partno = s1.partno
group by s1.partno

最佳答案

因为您在内部select(s1)partno中将别名别名为"Partno",所以在外部查询中必须将其称为区分大小写:

select s1.*
, p.city as "Produktionsort"
, p.partname
from (select count(s.partno) as "Anzahl_Produktarten"
, s.partno as "Partno"
from company.supp_part_job s
group by s.partno ) s1
, company.part p
where s1."Partno" IN (select p1.partno from company.part p1 where p1.city != 'London')
and p.partno = s1."Partno"
group by s1."Partno"

关于sql - oracle sql开发人员: 00904. 00000- "%s: invalid identifier"。我的错在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23548568/

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