Prøv en venstre join:
select * from task t
left join unit ut on ut.id = t.unit_id
left join building bt on bt.id = t.building_id
Prøv en venstre join:
select * from task t
left join unit ut on ut.id = t.unit_id
left join building bt on bt.id = t.building_id