Include 'AS' in the sql statment where aggregation is used.
Add tests to the SQL Helper.