The problem is that you need to state LEFT OUTER JOIN
(or FULL or RIGHT) instead of OUTER JOIN
. Oracle is seeing OUTER
in your SQL as a table alias. That is, it's reading it as:
SELECT Staff.Fname AS "First Name", Staff.Lname AS "Second Name", Booking_ID
FROM Staff foo
JOIN Booking ON Staff.StaffID = Booking.StaffID;
Although it would look strange, this would actually work:
SELECT OUTER.Fname AS "First Name", OUTER.Lname AS "Second Name", Booking_ID
FROM Staff OUTER JOIN Booking ON OUTER.StaffID = Booking.StaffID;
Oracle would see this as a simple inner join between the STAFF table (aliased as OUTER), and BOOKING.
Essentially, OUTER
is a keyword but not a reserved word in Oracle. That is, it has special meaning but can still be used as an alias.