3 ms·
select userid, name from users group by userid, name is equivalent to select distinct userid, name from users It's easy to add another column to the "distinc
by schrodinger 13y ago
select userid, name from users group by userid, name
is equivalent to
select distinct userid, name from users
It's easy to add another column to the "distinct" based query and change the behavior accidentally. With the "group by" query, you'd get an error saying that the new column needs to be either aggregated or added to the group by.