SELECT sites.sitename, COALESCE(Count(vulns.id), 0) AS Totals ON sites.id = systems.siteid LEFT JOIN vulnsON vulns.systemid = systems.id
AND vulns.risk_factor = se
SELECT b.BG_SEVERITY as Severity, count (b.BG_BUG_ID) as Total b.BG_USER_12='QA3'group by b.BG_SEVERITY
FROM BUG s wheres.BG_USER_12='QA1'
group by s.BG