4 ms·
MySQL 8 has ANY_VALUE() [1] to do just this. Also your example does not work any longer unless that now-deprecated behavior is explicitly enabled. select a
by meritt 7y ago
MySQL 8 has ANY_VALUE() [1] to do just this. Also your example does not work any longer unless that now-deprecated behavior is explicitly enabled.
select a, any_value(b), any_value(b) from table group by a
https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_any-value https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functi...
- Groxx 7y agoyea, that's much clearer about intent. the other form is rather accident-prone. do you know if it allows different row values for a and b though? (tbh I'm not sure if the old version did or did not, but I've never seen it return data blended from multiple rows...)