News for hackers. Stuff that matters.
Re:Distinct on: a confusing, unique and useful feature in Po... by meritt on Saturday March 21, 2020 @01:30AM (#22644741)
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-functi...
Re:Distinct on: a confusing, unique and useful feature in Po... by Groxx on Saturday March 21, 2020 @06:32PM (#22650800)
yea, 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...)