您需要枚举值以对其进行透视:
select id, max(case when seqnum = 1 then club end) as club_1, max(case when seqnum = 2 then club end) as club_2, max(case when seqnum = 3 then club end) as club_3from (select b.*, row_number() over (partition by id order by club) as seqnum from b ) bgroup by id;



