I’m trying to select multiple rows over different tables but I can’t get it to work whatever I do.
I get this error:
Error(14,1): PL/SQL: ORA-00918: column ambiguously defined
Code (Note, this is part of a trigger, that’s why there’s the :new):
SELECT brw.borage, bt.agelower, bt.ageupper
INTO borAge, minAge, maxAge
FROM Borrower brw, BookTitle bt
INNER JOIN BookCopy bc ON :new.bcID = bc.bcID
INNER JOIN BookTitle bt ON bt.isbn = bc.isbn
NOTE: BookTitle has only ONE ageLower and ageUpper column. There’s no declerations apart from borAge, minAge and maxAge either.
Tre problem is that you have two times the sames alias, try this:
but this can give you more results then expected, because you put BookTitle table on the FROM part.
I think that only this might be what you really need: