我有一个甲骨文的SQL查询的这个部分(其它更多的上面是不适用的问题) ...奇怪无效标识符错误的Oracle SQL
authorw as (
select a.id, (sum(p.w)) "theWeightOfTheAuthor"
from ac a, pc p, authorpublication ap
where a.id = ap.aid and ap.pid = p.id
group by a.id)
select authorCount.id "ID", auth.name "NAME", authorCount.c "TOTAL_NUMBER_OF_PUBS",
athw.theWeightOfTheAuthor "W_SCORE",
(authorCount.C/athw.theWeightOfTheAuthor) "MULT"
from ac authorCount, authorw athw, Author auth
where authorCount.id = athw.id and authorCount.id = auth.id
order by TOTAL_NUMBER_OF_PUBS desc;
在那里我收到一个错误:
ORA-00904: "ATHW"."THEWEIGHTOFTHEAUTHOR": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 404 Column: 22
线404是从最后一行第四:
(authorCount.C/athw.theWeightOfTheAuthor) "MULT"
注:我可以访问athw.id
就好了,如果我执行到authorw
创建,表格会按预期正确打印theWeightOfTheAuthor
列。是什么赋予了?
因为'theWeightOfTheAuthor'是一个不同的名称,所以''theWeightOfTheAuthor'''。有关详细信息,请参阅手册:https://docs.oracle.com/database/121/SQLRF/sql_elements008.htm#SQLRF00223 –