You need to specify the ON clause of the join syntax before specifying a new join, if I am not mistaken. For instance, instead of using
Code:
RIGHT OUTER JOIN theater INNER JOIN row...
You need to use:
Code:
RIGHT OUTER JOIN theater ON eventshow.Theater_ID = theater.IDNR
INNER JOIN row ON row.Theater_ID = theater.IDNR
The table structure shown in the diagram does not look optimal. You probably want to rethink the query. Maybe something like this:
Code:
SELECT ...
FROM seat_reservation
INNER JOIN status ON status.IDNR = seat_reservation.status_id
RIGHT JOIN seat ON seat_reservation.seat_id = seat.IDNR
INNER JOIN row ON seat.row_id = row.IDNR
INNER JOIN theater ON row.theater_ID = theater.IDNR
INNER JOIN eventshow ON theater.IDNR = eventshow.theater_id
WHERE eventshow.IDNR = 1 AND eventshow.theater_id = 1;