Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
成績の平均を作りたい
このようなテーブルがあります(2つのテーブルのINNER JOIN)
+-------+------+ | grade | unit | +-------+------+
解像度として(グレードと単位)を掛けたい
次に、解像度の平均を取得します
私はphpでそれを行うことができますが、1つのSQLでのみ作成する必要があり、結果は次のようになります。
1つのフィールド
どうもありがとうございます
SELECT AVG(grade * unit) FROM ...
select grade,unit, AVG(grade *unit) as average from ...