countyName, reAdmits = MAX(COALESCE(z.c, 0)), totalVisits = MAX(y.c) FROM y LEFT OUTER JOIN z ...
stackoverflow.com