RE: JOINing complication, help please

2004-06-03 Thread SGreen
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

RE: JOINing complication, help please

2004-06-02 Thread Luc Foisy
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]

RE: JOINing complication, help please

2004-06-02 Thread Luc Foisy
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

Re: JOINing complication, help please

2004-06-02 Thread SGreen
06/02/2004 11:31 cc: "MYSQL-List (E-mail)" <[EMAIL PROTECTED]> AM Fax to: Subjec

Re: JOINing complication, help please

2004-06-02 Thread SGreen
D]> -magic.com> cc: Fax to:

re: JOINing complication, help please

2004-06-02 Thread Luc Foisy
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))

JOINing complication, help please

2004-06-02 Thread Luc Foisy
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