简体   繁体   English

MS Access SQL 查询中分组组的总和

[英]SUM of grouped group in MS Access SQL query

I have a table with 6 columns:我有一个有 6 列的表:

ID_flower | Name                        | Price | Flower color | Flowering period | Pot sizes
----------+-----------------------------+-------+--------------+------------------+----------
  65      | Anemone japonica Wirbelwind |  10   | white        | VII-IX           | 11x11x11
  71      | Anemone nemorosa Rosea      |   5   | pink         | III-IV           | 9x9x9
  73      | Asphodeline lutea           |   8   | yellow       | VI               | 9x9x9

I want to group them by pot sizes, and sum this by pot sizes in MS Access query:我想按锅尺寸对它们进行分组,并在 MS Access 查询中按锅尺寸求和:

Pot sizes | Number of flowers
----------+------------------
11x11x11  | 1
9x9x9     | 2

Do you just want aggregation?你只是想要聚合吗?

select pot_size, count(*)
from mytable
group by pot_size

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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