您可以使用条件聚合:
select country, sum(case when position = 1 then 1 else 0 end) as pos_1, sum(case when position = 2 then 1 else 0 end) as pos_2, sum(case when position = 3 then 1 else 0 end) as pos_3from tgroup by countryorder by sum(pos) asc;

您可以使用条件聚合:
select country, sum(case when position = 1 then 1 else 0 end) as pos_1, sum(case when position = 2 then 1 else 0 end) as pos_2, sum(case when position = 3 then 1 else 0 end) as pos_3from tgroup by countryorder by sum(pos) asc;