I have a simple mysql query that work fine but it does not return all the values . All the values are returned when I use the left joined table alone but when I add the other tables only those that are all “=” return a value. Here is the query:
SELECT
d.flight_no , b.arrival_flight
FROM
jtl_booking_transfer_details AS b
LEFT JOIN jtl_flight_info AS d
ON (d.flight_no b.arrival_flight),
jtl_booking_master a,
jtl_hotels c,
jtl_airlines e
WHERE
a.voucher_number = b.voucher_number AND
b.hotel_id = c.hotel_id AND
e.airline_code = d.airline_code
Use the same syntax for getting all tables (easier to read : JOIN for … joining tables, WHERE clause for other predicates)