我在google sheet中有一个(重复的)城市列表,我想使用count和group by函数,然后得到重复最多的城市(可能是前三个)。
=QUERY(xx!1:9895,
"select count(K) // k is the city col
group by K
order by count(K) DESC
label count(K) 'Cites'");
我不确定我应该使用什么函数来获得复制最多的城市,我已经尝试过max,但它不起作用。
发布于 2021-04-19 19:21:34
试试这个:
=query(
xx!K1:K,
"select K, count(K)
where K is not null
group by K
order by count(K) desc
limit 3
label K 'City', count(K) 'Count' ",
0
)
https://stackoverflow.com/questions/67160643
复制相似问题