我必须进行选择,被联合在一个简单的查询...MySQL的:SUM 2页联合在一起的表(4×SUM在一个结果)
SELECT description_x, a, b, c, d from table a WHERE person_id = 1 UNION SELECT description_y, e ,f ,g ,h from table b WHERE person_id = 1
... A,B,C,d,E,F ,g,h都是整数。我怎样才能他们,结果会看起来像这样...
row 1: description_x | a | b | c | d row 2: description_y | e | f | g | h row 3: summary | a+e | b+f | c+g | d+h
...好吗?
非常感谢!
c似乎与c有任何关系似乎很奇怪。 – Strawberry