Handle group by without aggregates by adding an aggregate behind the scene.

Normal:
SELECT g, count(ng) GROUP BY g

Special:
SELECT g GROUP BY g

Reviewed-by: robert.macomber@socrata.com