2
我有5個表(bepd,tirpd,elpd,frpd,kopd)與同名列「Up」列,我想使從所有表中總結並顯示在一個php代碼中。誰能幫我 ?我想從5列有一列名爲「UP」的總和
我有5個表(bepd,tirpd,elpd,frpd,kopd)與同名列「Up」列,我想使從所有表中總結並顯示在一個php代碼中。誰能幫我 ?我想從5列有一列名爲「UP」的總和
select sum(SumUp)
from (
select sum(up) as SumUp
from Table1
union all
select sum(up)
from Table2
union all
select sum(up)
from Table3
union all
...
) SubQueryAlias
您正在做的數額超過您的需要。 – Strawberry 2013-05-04 10:46:12