I'm certain this has been asked and answered already but don't know how exactly the question should be.
I have two tables
ID | name
=========
1 | foo
2 | bar
3 | lou
4 | sue
and a meta table:
p_ID | key | value
===================
1 | poo | 1
2 | zoo | 'whatever'
3 | clu | 423
4 | poo | 1
I like to get all entries from the first table which doesn'T have a poo value assigned:
ID | name
=========
2 | bar
3 | lou
My approach was
SELECT *
FROM table AS p
LEFT JOIN meta AS m
ON m.p_id = p.ID
WHERE m.key = 'poo'
AND m.value IS NULL
but this returns an empty result