I need to create a recordset which Joins 3 rows from one table on 1 row from another table.
At present I have:
SELECT *
FROM tb_product_sub_cat
LEFT JOIN tb_products ON tb_product_sub_cat.category_id = tb_products.product_subcategory
WHERE tb_product_sub_cat.category_name = %s
I also need:
tb_product_sub_cat.category_id = tb_products.product_subcategory2 AND
tb_product_sub_cat.category_id = tb_products.product_subcategory3
I need to find all products that have 'stuff' in either/or all of the product categories.