用sql的avg(score)求完平均值后,保存两位小数的方法(用于查询或视图)

查jx_score表的平均值,以哪次考试(testid)和科目分组(courseid)

select

testid,

courseid,

round(avg(`jx_score`.`score`),2) AS `average`

from `jx_score`

group by `jx_score`.`testid`,`jx_score`.`courseid`

原文地址:https://www.cnblogs.com/fzly-88/p/7084088.html