3 ms·
If you are a database user, sure, you are at mercy of database developer. But if you are writing a database yourself, it is entirely up to you which representa
by theamk 4y ago
If you are a database user, sure, you are at mercy of database developer.
But if you are writing a database yourself, it is entirely up to you which representative will be returned by GROUP BY. You can take an easy way out and implement "return non-deterministic random member of the group" strategy. Or you can choose the representative with smallest UTF-8 point values, so it will be fully deterministic (I'd prefer this one personally). Or choose row with smallest insertion date. Or let user choose. There are tons of options.