I have this straight forward query:
SELECT f.id, f.format_type, h.newspaper_id
FROM newspapers_formats f
LEFT JOIN newspapers_formats_held h
ON (f.id = h.format_id)
This returns all format_types, format ids, and the newspaper id that we have for that format. What I need is to then limit it to only newspaper_id = x, however, if I do this with a WHERE, like this:
SELECT f.id, f.format_type, h.newspaper_id
FROM newspapers_formats f
LEFT JOIN newspapers_formats_held h
ON (f.id = h.format_id)
WHERE h.newspaper_id=3
Then I'm only getting the formats that we have in that newspaper. I still need all formats, regardless if that newspaper has it.
Hopefully this makes sense. Ask for clarification if needed.