How to make this syntax works :
SELECT *
FROM
uploads,
audienceuploadassociation
WHERE
uploads.member_id = '1'
AND uploads.member_school_id='1'
AND subject = 'Maths'
AND uploads.upload_id = audienceuploadassociation.upload_id
AND topic = 'Integers'
AND year IN(7, 8, 9)
AND audienceuploadassociation.audiencename LIKE (Parents, Teachers, Community)
Your
LIKEclause is faulty. I suspect that you intend to use anIN()clause instead:If you are trying to match partial strings with
LIKE, you need toORthem together in a()group, as in:Note also, that the implicit join syntax you are using (comma-separated tables) is deprecated in favor of an explicit
JOIN.Finally, I would recommend explicitly naming the columns you want rather than doing
SELECT *, so you get them in a deterministic order, and guard against the addition of other columns later that you don’t need in this query: