id | model | name | category | price |
---|---|---|---|---|
1 | C-XM01 | モーダンチェア | チェア | 56000 |
2 | X-XD05 | ラージデスク | テーブル | 87000 |
3 | A-DA40 | ラウンドダイニングチェア | チェア | 28000 |
4 | O-XX100 | ナチュラルオフィス | チェア | 13800 |
5 | R-D400 | ラウンドダイニングテーブル | テーブル | 128000 |
6 | R7000 | ウッドキャビネット | その他 | 32000 |
select category, AVG(price) as average
from products group by category having AVG(price) > 50000
category | average |
---|---|
テーブル | 107500.000000 |
select * from(
select category, AVG(price) as average from products group by category
) as query where average > 50000
category | average |
---|---|
テーブル | 107500.000000 |