简体   繁体   中英

Count of all occurrences on all rows

I need to complete an overall count of occurrences of one column and all rows.

As an example of data:

在此处输入图像描述

How many times the place has occurred.

I've done this so far which counts the years but how do I then do a count on that count

SELECT year,count(year)
from
countries group by place-name

So how do I now count my places by the year counts? For example Birkenhead would equal 7

Try

select DISTINCT(place-name), count(*) 
from 
countries group by place-name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM