Skip to content · ⁨コンテンツへスキップ⁩

Counting and averaging · ⁨カウントと平均値⁩

English

Summarising with aggregate functions

Sometimes you do not want the rows themselves, but a summary of them. Aggregate functions turn many rows into a single value:

  • COUNT(*) — how many rows
  • SUM(col) — the total
  • AVG(col) — the average
  • MIN(col) / MAX(col) — the smallest / largest

日本語

集計関数による要約

時折、行そのものではなく、それらの要約が欲しい場合があります。集計関数は多数の行を単一の値に変換します:

  • COUNT(*) — 行数のカウント
  • SUM(col) — 合計
  • AVG(col) — 平均
  • MIN(col) / MAX(col) — 最小値 / 最大値
SELECT COUNT(*) FROM student;

COUNT, SUM および AVG は、それぞれ全体のカラムを単一の数値に圧縮します

Handout · ⁨プリント⁩

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP