I often use this in Teradata SQL assistant:
row_number() over(partition by X||Y order by Z desc) = 1
The two are very similar. However, the version with the commas is correct (for most purposes). Consider what happens in these cases:
X Y A BC AB C
The concatenation version will combine them both into "ABC", but you probably don't want to do that. The comma version treats the values as ('A', 'BC') and ('AB', 'C'), so they are separate -- just as if you did
group by X, Y.
Only concatenate the values together if that is really your intention.