* | * |
---|---|
链接 | SQL Basics: Simple JOIN and RANK |
难度 | 6kyu |
状态 | √ |
日期 | 2019-03-27 |
题意
题解1
select rank() over (order by count(sales.sale)) as sale_rank ,people.id, people.name,
count(sales.sale) as sale_count
from people
left join sales
on people.id = sales.people_id
group by people.id