Skip to content
Advertisement

SUM of grouped group in MS Access SQL query

I have a table with 6 columns:

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:

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

Advertisement

Answer

Do you just want aggregation?

select pot_size, count(*)
from mytable
group by pot_size
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement