MySQL Forums
Forum List  »  Newbie

query problem joining 2 tables with where clause only filtering one table
Posted by: Tony Elmiger
Date: August 08, 2005 06:19PM

I have 2 tables that I would like to join.


Select clients.*, contacts.*
FROM clients LEFT JOIN contacts ON
clients.client_id = contacts.contact_id
Where contacts.hide = 0


The problem I have with the above query is that if I have 1 client record and 1 contact record with the hide field = 1 the client record is not displayed anymore either.

I would like that if the contact is set to hidden that the client record will still appear on the list with the contact fields empty just like you would get if you have a client record but not a contact record.

Any help would be appreciated.

Options: ReplyQuote


Subject
Written By
Posted
query problem joining 2 tables with where clause only filtering one table
August 08, 2005 06:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.