I join several tables for selection
If in the 2nd, 3rd, 4th tables there is nothing suitable, I still want to pull the results until the first table has a match. I thought LEFT JOIN did this, but it is not.
Here is the complete request:
SELECT cart_product.*, prod_drop_products.prod_drop_product_name, everlon_sheet.*, cart_product.product_id AS product_id
FROM cart_product
LEFT JOIN everlon_sheet ON cart_product.product_id = everlon_sheet.product_id
LEFT JOIN prod_drop_products ON cart_product.product_id = prod_drop_products.product_id
LEFT JOIN prod_drop ON prod_drop.prod_drop_id = prod_drop_products.prod_drop_id
WHERE prod_drop.prod_drop_name = "Carat Weight" AND cart_product.product_brand = "everlon"
ORDER BY cart_product.product_manufacturer_num
which pulls results 316
Here is a query without unions:
SELECT cart_product.*
FROM cart_product
WHERE cart_product.product_brand = "everlon"
ORDER BY cart_product.product_manufacturer_num
which pulls 362 results
I have a suspicion that this is due to my WHERE clause prod_drop.prod_drop_name = "Carat Weight in JOIN qry. But is there any way to pull what I need in my request above, but still pull everything from the first (the leftmost , cart_product) tables, even if nothing matches other tables?
Thanks!!