結合(JOIN)

INNER JOIN (内部結合)
SELECT * FROM threads INNER JOIN responses ON threads.id = responses.thread_id;

SELECT * FROM responses INNER JOIN threads ON threads.id = responses.thread_id;

LEFT OUTER JOIN (左外部結合)
SELECT * FROM threads LEFT JOIN responses ON threads.id = responses.thread_id;

SELECT * FROM responses LEFT JOIN threads ON threads.id = responses.thread_id;

RIGHT OUTER JOIN (右外部結合)
SELECT * FROM threads RIGHT JOIN responses ON threads.id = responses.thread_id;

SELECT * FROM responses RIGHT JOIN threads ON threads.id = responses.thread_id;

