without order table
Code:
SELECT address_book.entry_company, address_book.entry_firstname, address_book.entry_lastname, address_book.entry_suburb, address_book.entry_city, address_book.entry_state, address_book.entry_postcode, address_book.entry_country_id, countries.countries_name, customers.customers_telephone, customers.customers_email_address
FROM countries INNER JOIN (address_book INNER JOIN customers ON (address_book.address_book_id = customers.customers_default_address_id) AND (address_book.customers_id = customers.customers_id)) ON countries.countries_id = address_book.entry_country_id;
with order table
Code:
SELECT orders.customers_name, orders.customers_company, address_book.entry_firstname, address_book.entry_lastname, address_book.entry_street_address, address_book.entry_suburb, address_book.entry_city, address_book.entry_state, address_book.entry_postcode, address_book.entry_country_id, orders.customers_telephone, orders.customers_email_address
FROM (address_book INNER JOIN orders ON address_book.customers_id = orders.customers_id) INNER JOIN customers ON (address_book.address_book_id = customers.customers_default_address_id) AND (address_book.customers_id = customers.customers_id);
because I'm lazzy, all is done via ms-access && that works very well in phpMyAdmin
Bookmarks