Comments - SQL_MODE

1 year, 7 months ago F S

Does the mode ONLY_FULL_GROUP_BY allow columns which are functionally dependent upon the GROUP-BY-clause? Concerning this documentation, it does not seem to be the case, but is explicitely allowed by the SQL Standard. (o. k., up to really old versions) I could imagine that the mode was created to only forbid select columns which differ within the group and could in principle give different results during different runs. These would be columns - which are not an aggregate function - and which are not in the GROUP-BY-clause - and which are not functionally dependent upon the GROUP-BY-clause.

 
1 year ago Emil Angelov

As of yet, functionally dependent non-aggregated columns are not allowed when ONLY_FULL_GROUP_BY is set. Just tested in 10.6. Maybe the behaviour is different in some of the more recent versions but I doubt it.

I think your imagination is correct. After all, if all rows within a group have the same value for a given column, then it shouldn't matter which row the value is selected from.

https://jira.mariadb.org/browse/MDEV-11588

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.