我有三个名为EasyPaisa
,TimePay
和Omni
的表,其中Profit
字段为EasyPasia
(10,10)
,Omni
得到(15,15)
,TimePay
获得(20,20)
。
当我通过此查询获取利润时:
SELECT
Sum(EasyPaisa.Profit) AS Expr1,
Sum(Omni.Profit) AS Expr2,
Sum(TimePay.Profit) AS Expr3
FROM
EasyPaisa,
Omni,
TimePay;
它给我的结果加倍实际结果
答案 0 :(得分:0)
你在找这个吗?
SELECT
(SELECT SUM(Profit) FROM EasyPaisa) Expr1,
(SELECT SUM(Profit) FROM Omni) Expr2,
(SELECT SUM(Profit) FROM TimePay) Expr3
输出:
| EXPR1 | EXPR2 | EXPR3 |
-------------------------
| 20 | 30 | 40 |
这是 SQLFiddle 演示。