用left join连接person表和task表,这样左表person的全部值都保留,右表task对应不上的就显示null
select p.id, p.name, t.content
from person as p
left join task as t
on p.id = t.person_id
用left join连接person表和task表,这样左表person的全部值都保留,右表task对应不上的就显示null
select p.id, p.name, t.content
from person as p
left join task as t
on p.id = t.person_id