グループごとにまとめていく group by を やっていきましょう
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#(12)データをグループ化する group by句 -- (1)都道府県id (prefecture_id)ごとにグループ化する -- count()はprefecture_idでグループ化された各グループに対して行っている。 select prefecture_id,count(*) from users group by prefecture_id; -- (2)2017 月別のユニークアクセスユーザー数 select request_month, count(distinct user_id) from access_logs where request_month>='2017-01-01' and request_month<'2018-01-01' group by request_month; |
The following two tabs change content below.
Keita N
最新記事 by Keita N (全て見る)
- DDPG by gymnasium 16日目 - 2023年6月5日
- DDPG by gymnasium 15日目 - 2023年6月2日
- DDPG by gymnasium 14日目 - 2023年6月1日