- Use
UNION
to get your distinct list of names
- Use
LEFT JOIN
to retrieve your data
Example:
SELECT list.names, t1.assigned, t2.unsassigned, t3.closed, t4.open
FROM
(select names from table1
union select names from table2
union select names from table3
union select names from table4
) list
LEFT JOIN table1 t1 ON (list.names = t1.names)
LEFT JOIN table2 t2 ON (list.names = t2.names)
LEFT JOIN table3 t3 ON (list.names = t3.names)
LEFT JOIN table4 t4 ON (list.names = t4.names)