「SQL」集約関数AVG()で平均値を返すサンプル
書式
SELECT AVG(カラム名)
FROM テーブル名
WHERE 条件式;
使用例
select
    avg(price) 
from
    products;
結果
AVG(Price)
28.8663636
Coding Changes the World
書式
SELECT AVG(カラム名)
FROM テーブル名
WHERE 条件式;
使用例
select
    avg(price) 
from
    products;
結果
AVG(Price)
28.8663636