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.
我想平均成绩
有一个这样的表(两个表的INNER JOIN)
+-------+------+ | grade | unit | +-------+------+
我想将(等级和单位)乘以 res
然后,获得 res 的平均值
我可以用 php 来做,但我只需要用一个 sql 来做,结果必须在
一个领域
非常感谢
SELECT AVG(grade * unit) FROM ...
select grade,unit, AVG(grade *unit) as average from ...