I have a table named
posts and another table named
post can have many
So, I create a middle table called
How to get the list of
posts data including the
attachments data in A SINGLE QUERY?
Please refer below to make it clearer to understand...
Below are the table structure:
posts table have 4 columns:
attachments table have 3 columns:
post_attachment table have 2 columns:
Below are the example of a
post that have multiple
In the example above, it tells the
post (ID: 1) has 3
attachments which is ID: 1,2 and 3.
So, the question is How to GET the list of posts which will have columns
attachments.file_url in A SINGLE QUERY?