Toad World® Forums

Feature: auto GROUP BY



one of the cases that often annoys me while writing select statements with an
aggregate function, is that I forget adding GROUP BY clause. I get syntax error,
I say the sh** word, and I add the GROUP BY clause and copy/paste grouping
columns. It’s my mistake, I know, I should be more careful. But couldn’t
Toad just say, “hey, you have an aggregate function there, should I add the
according GROUP BY clause for you?”

I don’t know if people would think that this would lead Toad to be a
“SQL for dummies editor”, but I don’t think so. I don’t think
it bothers anyone. Personally I go further and claim that GROUP BY clause should
never have been in the SQL standard. How often do you run a select statement
with different grouping columns than in column list? Anyway, this is another
discussion topic.

BTW, the same should also apply when I add/remove columns from column list and
forget reflecting this change in GROUP BY clause.