标签: php
我想将两列上的值相乘...一列名为“point”,另一列名为“unit”。我实际上想要在两列上乘以值,然后将乘积值的总和相加。我该怎么做呢?
答案 0 :(得分:0)
I hope you lookin something like this.. SELECT sum(total) FROM ( SELECT col1 * col2 AS total FROM your_table tbl1 ) tbl2
答案 1 :(得分:0)
在SUM()和point
SUM()
point
unit
SELECT SUM(point * unit) total FROM Table1
这是 SQLFiddle 演示