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.
我们可以得到 mysql 表中具有整数的几列的总和吗?
A B C D 1 0 2 3
我需要得到所有列的总和。我有一排。
然而,似乎数据模型很尴尬,
select a+b+c+d from ... where ...
select suma+sumb+sumc+sumd from (select sum(A) as suma,sum(B) as sumb,sum(C)as sumc,sum(D) as sumd from tab) mytab