would
assume that if a record exists in CONTACT_X_CUSTOMER then there would be
corresponding records in both of those tables.
I know this has been a huge post but you
Oops, that LEFT JOIN ADDRESS ON IF(etc...) shouldn't be in the big long select
statement
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
D, IF(CUSTOMER.ID_ADDRESS_SHIPTO > 0,
CUSTOMER.ID_ADDRESS_SHIPTO = ADDRESS.ID, CUSTOMER.ID_ADDRESS_MAIN = ADDRESS.ID)
This actually worked great, I only had to refer to ADDRESS once in the select for
output, I only had to join the other tables CITY, PROVINCE, COUNTRY once on ADDRESS
too.
BUT
06/02/2004 11:31 cc: "MYSQL-List (E-mail)" <[EMAIL
PROTECTED]>
AM Fax to:
Subjec
D]>
-magic.com> cc:
Fax to:
Ok, I got a result here, still trying to determine if its correct or not :)
LEFT JOIN ADDRESS ON IF(CONTACT_X_CUSTOMER.ID_ADDRESS > 0,
CONTACT_X_CUSTOMER.ID_ADDRESS = ADDRESS.ID, IF(CUSTOMER.ID_ADDRESS_SHIPTO > 0,
CUSTOMER.ID_ADDRESS_SHIPTO = ADDRESS.ID, CUSTOMER.ID_ADDRESS_MAIN = ADDRESS.ID))
CONTACT_X_CUSTOMER.ID_ADDRESS
CUSTOMER.ID_ADDRESS_SHIPTO
CUSTOMER.ID_ADDRESS_MAIN
What I would like is to be able to JOIN conditionally based on the absence/presence of
reference
SELECT ADDRESS.ID FROM CONTACT_X_CUSTOMER LEFT JOIN CUSTOMER ON
CONTACT_X_CUSTOMER.ID_CUSTOMER = CUSTOMER.ID
(that