3 ms·
It's already grouping by the primary key of `product`. Why would you need to add another column in `product` to the group by?
by Dylan16807 4y ago
It's already grouping by the primary key of `product`. Why would you need to add another column in `product` to the group by?
- jbverschoor 4y agoIf that’s the very specific case, then they should be clear about it. But my interpretation was that our order by ungrouped column If it’s about preferring by non selected columns, that’d be fine. Something is wrong somewhere imo
- amluto 4y agoI assume that query optimizers are able to detect a GROUP BY of a primary key and other columns in the same table and optimize accordingly. But using this trick to change the set of valid queries seems odd. I think I'd rather see special syntax for it: GROUP BY table.*