2

我有 5 个表(bepd、tirpd、elpd、frpd、kopd)与名为“Up”的同一列,我想从所有表中得出 Up 的总和并在 php 代码中显示它。谁能帮我 ?

4

1 回答 1

2
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
于 2013-05-04T10:04:40.747 回答