Google Spreadsheets:如何按洲查询人口最多的国家/地区? [英] Google Spreadsheets: How to query countries with max population by continent?

查看:130
本文介绍了Google Spreadsheets:如何按洲查询人口最多的国家/地区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一张表格,其中包含国家,大陆和人口列.

Let's say I have a table with the columns country, continent and population.

如何使用Google Spreadsheets中的QUERY函数为每个大洲选择人口最多的国家?

How can I use the QUERY function in Google Spreadsheets to select, for each continent, only the country with the highest population?

在常规SQL中,我想我会使用HAVING,但这在这里似乎不是一个选择.

In regular SQL I think I'd use HAVING, but this doesn't seem to be an option here.

推荐答案

=SORTN(SORT(G:J,4,0),2^99,2,3,0)

  • 按人口排序的降序排列(如果尚未完成的话)
  • 使用SORTN删除重复项
  • 这篇关于Google Spreadsheets:如何按洲查询人口最多的国家/地区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆