美文网首页
SQL Basics: Simple JOIN and RANK

SQL Basics: Simple JOIN and RANK

作者: 是不及呀 | 来源:发表于2019-03-26 18:00 被阅读0次
    * *
    链接 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

    相关文章

      网友评论

          本文标题:SQL Basics: Simple JOIN and RANK

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