Unexpected behaviour for GROUP BY query
GROUP BY by primary key column causes each row to become a separate group. In this case the column not included into grouping / aggregating has only one value within the group, so this value may be returned without ambiguity.
If there is no primary column / expression as a part of grouping expression then server must consider that there may be more than one value for a group, and it generates error because of possible ambiguity.
In general the fact that the error is not generated is an extension it seems...
If PK is a part of grouping expression than formally all another parts are excess. I.e. if id is PK then group by id, group by id,a,b,x, group by id,a,b, group by id,b,x, group by id,a,x, ... will have the same meaning and effect.
But the best practice is to use an aggregate function for each non-groupby column / expression in any case.