美文网首页
Leetcode 618. 学生地理信息报告

Leetcode 618. 学生地理信息报告

作者: 七齐起器 | 来源:发表于2021-12-15 12:46 被阅读0次

地址 https://leetcode-cn.com/problems/students-report-by-geography/

select 
b.name 'America'
,c.name 'Asia'
,d.name 'Europe'
from(
select distinct row_number() over(partition by continent order by name)id
from student 
order by name
)a left join (
select  name,row_number() over(partition by continent order by name)id
from student where continent='America'
)b on a.id=b.id left join(
select  name,row_number() over(partition by continent order by name)id
from student where continent='Asia' 
)c on a.id=c.id left join(
select  name,row_number() over(partition by continent order by name)id
from student where continent='Europe' 
)d  on a.id=d.id 

相关文章

网友评论

      本文标题:Leetcode 618. 学生地理信息报告

      本文链接:https://www.haomeiwen.com/subject/qztpfrtx.html