I'm confused and also suffering from Friday blues...
Basically I'm looking to pull all the information from my itinerary tables in my database and create an invoice from it.
(Invoice bit fine)...
Individually the queries are all fine but pulling them together ain't happening and also is there a better way of doing it.
Code: Select all
accommodationDate, accommodationName, duration, roomType, boardBasis,
accommodation.notes, flightDate, a1.airportName, a2.airportName, flightNum,
departureTime, arrivalTime, cruiseDate, departurePoint, arrivalPoint,
cruiseCompany, cruiseName, cabinType, misc.notes
LEFT JOIN accommodation ON accommodation.itineraryID = itinerary.itineraryID
LEFT OUTER JOIN flights ON flights.itineraryID = itinerary.itineraryID
LEFT OUTER JOIN cruises ON cruises.itineraryID = itinerary.itineraryID
LEFT OUTER JOIN misc ON misc.itineraryID = itinerary.itineraryID
LEFT JOIN bookings ON itinerary.bookingID = bookings.bookingID
LEFT OUTER JOIN airports a1 ON flights.flightFrom = a1.airportID
LEFT OUTER JOIN airports a2 ON flights.flightTo = a2.airportID
WHERE bookings.bookingRef = "000001"
Currently only pulling in the flight info and subsequently the airport names.
Assume the problem is with the joins, tried inner/outer/left/right etc with no success.
Have read upon it but not really helping.
Greatly appreciate any help.