For for incorrect sql (aggregates with columns)
Fixed wrong syntax when no columns are set
Merge pull request #145 from johanneslumpe/patch-2

For for incorrect sql (aggregates with columns)