fix bug 972165 - group by buildid, and also don't both with count query
Merge pull request #1885 from rhelmer/bug972165-gccrashes-adjustments

fix bug 972165 - group by buildid, and also don't both with count query