I'm trying to do a LEFT JOIN only if one of the columns in the table I'm joining = 1.
Here is what I have so far.
SELECT * FROM size, oil LEFT JOIN purchase ON oil. oilId = purchase. purOilId
WHERE sizId = oilSizeId AND oilUnused ='' ORDER BY oilOurName
What I need to add is below.
LEFT JOIN purhcase (only if purMark = 1)
This is what I'm not sure how to do.
It will not work to have an AND later on because the oil table needs to define how many rows are in the result.
Thanks