I am trying to join three tables in a MYSQL query where the vital table information is as follows:
CONTACTS
-cust_id
-f_name
-l_name
ISSUES
-cust_id
-product_id
- issue
- response
PRODUCTS
- product_id
- product_name
I want to view all of the issues with their corresponding contacts.f_name, contacts.l_name and products.product_name
The only hitch is that not every issue is given a product_id.
Using the following, I am able to join the tables successfully, but I only get the issues that DO have the product_id. I am missing the issues that DO NOT have the product_id:
SELECT c.f_name, c.l_name, i.issue, p.product_name FROM issues as i JOIN customers as c, products as p WHERE i.cust_id = c.cust_id and i.product_id = p.product_id
Is there a way to include the ISSUES that do not have a product_id entrie?
Any ideas??? Thanks!