Oracle DB - ORA-00904: "invalid identifier" select 错误

Oracle DB - ORA-00904: "invalid identifier" error on select

我是 Oracle DB 的新手,遇到了一个我不太明白的错误。

我有两个表,table1和table2,table1中的ID主键字段是table2中的外键。

这是一个运行良好的查询:

select c.* from table1 c
    inner join table2 c2 on c.ID = c2.RID

问题是我正在尝试编写一个更复杂的查询,一旦我向查询中添加更多表,我就会收到此错误 ORA-00904: C"."ID": invalid identifier,当我 [=26] =] 以下:

select c.* from table1 c, table3 a, table4 b
    inner join table2 c2 on c.ID = c2.RID

我查看了 this thread 寻求帮助,但它对我的情况没有真正帮助(除非我遗漏了什么,但我怀疑)

只需像这样将连接堆叠在一起:

select c.* 
from table1 c 
    inner join table2 c2 on c.ID = c2.RID
inner join table3 a on [c.ID = a.RID] --you have not provided the relations for this 
inner join table4 b on [c.ID = b.RID] --you have not provided the relations for this 

如果您仍然从 c.ID 得到无效标识符,我会仔细检查 ID 是否真的是正确的列名。

请提供 table 定义以及它们之间的关系以获得更好的答案