3 ms·
There is I guess no reason except that it would be confusing. "select *" normally means select all the columns in the table, which is ok for ad hoc eyeballing s
by stareatgoats 6y ago
There is I guess no reason except that it would be confusing. "select *" normally means select all the columns in the table, which is ok for ad hoc eyeballing smaller tables, where it saves you the typing involved of specifying possibly hundreds of columns - that syntax is not really ok for anything else.
But you are suggesting that the same syntax should be extended (by DBMS vendors presumably) to aggregate "group by" queries, where there is hardly any such efficiency gain involved; you absolutely need to specify the "group by" columns anyway, and you can simply copy that list over into the select statement. So you would achieve more confusion, and achieve almost no efficiency.
The only situation where your suggestion would make some sense would be if you routinely work with databases with tables that have many (hundreds?) of columns where a majority of these fields are included in "group by" statements. But these would be extreme edge cases in my experience. And the benefit would still be debatable.