0
に私は現在、最高の平均結果を得るために次のクエリを使用しています:私は最高の加重平均を算出するために、私のクエリを変更しようとしています加重平均は、MySQL
select ContentType, AVG(Result) as AvgContent from dopractice where S_Id [email protected]_Id group by ContentType order by 2 desc limit 1;
。例えば
:
((X*1)+(Y*2)+(Z*3))/3
単一のクエリを使用してこれを行う方法はありますか?
注:dopractice表の列(Id, StudentId, LessonId, ContentType, result, Date)
提案の加重平均をどのように計算しますか? – John