SELECT america,asia,europFROM(selectnameas america ,row_number()over() as id from leetcode.ex_618_student where continent ='America'order by America) a full join(selectnameas asia ,row_number()over() as id from leetcode.ex_618_student where continent ='Asia'order by Asia) b on a.id=b.idfull join(selectnameas europe ,row_number()over() as id from leetcode.ex_618_student where continent ='Europe'order by Europe) c on a.id=c.id ;