Hi all,
I am working on the following query to return all the rows from table1 and all the rows from table2 if there is a match on "f.AirlineCode" and "Airline"
The issue I have if there is not a match the rows in table1 are not returned. I have tried just about everything with on success.
I know its to do with "JOIN" but for the life on me I can't make this work.
f.CodeShare,
f.DayNumber,
f.ArriveDepart,
f.ScheduledTime,
f.SchStamp,
f.EstimatedTime,
f.EstimatedGateTime,
f.EstStamp,
f.Flight,
f.IATALookup,
f.`Status`,
f.Terminal,
f.AirlineCode,
a.Airline,
a.AirlineContact,
a.AirlineContactNo
FROM
LHRFlight24 f, AirlineContacts a
LEFT JOIN LHRFlight24 ON f.AirlineCode = a.Airline
AND (f.EstStamp - '" . $_SESSION['delayperiod'] . "' > f.SchStamp
AND f.CodeShare = '0'
OR f.`Status` = 'Cancelled')
ORDER BY f.ArriveDepart DESC, f.SchStamp ASC";
Can anyone help with this.
Many thanks.