1.分析
没有任务的也要输出null,所以要左连接task表。
2.代码
SELECT p.id, p.name, t.content FROM person as p LEFT JOIN task as t ON p.id = t.person_id ORDER BY p.id
1.分析
没有任务的也要输出null,所以要左连接task表。
2.代码
SELECT p.id, p.name, t.content FROM person as p LEFT JOIN task as t ON p.id = t.person_id ORDER BY p.id