件数
1 |
> select count(*) from users; |
ユニークデータのみ(重複無し)の件数
1 |
> select ditinct team from users; |
最大値/最小値/平均値/合計
1 2 3 4 |
> select max(score) from users; > select min(score) from users; > select age(score) from users; > select sum(score) from users; |
チームごとの平均スコア
1 |
> select team, ave(score) from users group by team; |
乱数
1 2 |
> select rand(); 0以上1未満の乱数 > select * from users order by rand() limit 1; |