I'm having trouble wrapping my head around a query. I have the following 3 tables:
documents (
id,
title
);
positions (
id,
title
);
documents_positions (
document_id,
position_id
);
What I am trying to get (my requested outcome) is a matrix of documents, and what positions they apply to. So each row would have document title, and then have a column for every position and a column next to it with True or False if the positions applies to the document. I suspect some kind of LEFT JOIN is required, because on each row after document, I want to list every position from the positions table and whether or not the document applies to it. Make sense?