1 2 3 4 5
SELECT count(*), ID FROM IDTable GROUP BY ID OUTER JOIN SumTable ON IDTable.ID = SumTable.ID