J'ai cette partie d'une requête SQL Oracle (beaucoup plus au-dessus qui ne concerne pas la question) ...étrange oracle d'erreur d'identification non valide 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;
où je reçois une erreur:
ORA-00904: "ATHW"."THEWEIGHTOFTHEAUTHOR": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 404 Column: 22
ligne 404 étant le quatrième de la dernière ligne:
(authorCount.C/athw.theWeightOfTheAuthor) "MULT"
REMARQUE: I peut accéder à athw.id
très bien, et si j'exécute jusqu'à la création authorw
, la table est imprimée correctement avec la colonne theWeightOfTheAuthor
comme prévu. Ce qui donne?
Parce que 'theWeightOfTheAuthor' est un nom différent, alors' 'theWeightOfTheAuthor ''. Voir le manuel pour plus de détails: https://docs.oracle.com/database/121/SQLRF/sql_elements008.htm#SQLRF00223 –