It does not always result in same answer,
there are two cases first if a is unique and it has certain repeating values.
Now lets try to understa group by and select, If group by on non unique terms and apply select term returns first value from each group.
And if terms are unique it will return single term by using group by or not