Using Count to find the number of occurrences

后端 未结 4 987
太阳男子
太阳男子 2020-11-29 06:26

Let\'s say I have a table with the following values.

Ford
Ford
Ford
Honda
Chevy
Honda
Honda
Chevy

So I want to construct the following outp

4条回答
  •  余生分开走
    2020-11-29 06:54

    select car_made, count(*) as occurrences
    from cars
    group by car_made
    order by occurrences desc, car_made
    

提交回复
热议问题