是否可以 select 前 10 项并将其余项放在其他项中?就像我们可以在 SQL

Is it possible to select top 10 items and put the rest of the items in others? Just like we can do in SQL

是否可以为 select 前 10 项创建一个 google 查询,并将其余的分组到其他类别中,就像我们可以对 SQL 所做的那样。我正在尝试从 Google 电子表格中提取数据。

这个例子只是为了让你开始 Google sheets queering

  1. 您必须按部分将前 10 名从组中分​​离出来。单独 sheet 获取除前 10 名以外的所有记录
=QUERY(Hours!A2:BC18, "select A, B order by A offset 10")
  1. 创建结果sheet。在第一个单元格中粘贴此查询,这将为您提供前 10 行
=QUERY(Hours!A2:BC18, "select A order by A limit 10")

接下来在第 11 行的单元格中,粘贴此查询(ExcludingTop10 是 sheet 在步骤 1 中创建的)

=QUERY(ExcludingTop10!A1:B7, "select MAX(A) GROUP BY B")

输出将类似于以下内容

1148002773
1148003048
1148003741
1148005962
1148006591
1148007576
1148007609
1148039351
1148050401
1148050580
max <- you can hide this cell as well
1148079677

您有 2 个 sheet,一个包含所有数据,另一个包含摘要。