|
Database engines should deal with "non-sense cases" too. Job of GROUP BY is not produce rows.
I agree with Adriano. We already had such a problem previously with GROUP BY <constant>. The current one should also be solved. Our GROUP BY processing is somewhat non-optimal (to say at least).
In my case, i was grouping by a "case", 'cause i need to group some rows from a procedure and keep others not grouped, but as the procedure didn't have a unique column, i used rand() to fake one. I fixed it changing the procedure to return a unique column and using it instead.
group by case when ... then ... else rand() end |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This seems to be a "non-sense case" -- it does not reflected anything close to a real-world scenario -- as such, I think this should be considered a "won't fix" case.
Can you explain why GROUP BY RAND() would ever be used?