请试试这个:
SELECT playerID, yearID, awards = STUFF( (select ',' + [awardID] from AwardsPlayers t where playerID = AwardsPlayers.playerID and yearID = AwardsPlayers.yearID for xml path('')) , 1 , 1 , '') FROM AwardsPlayers GROUP BY playerID, yearID