我对此查询如下:
$strSQL = "SELECT t1.*, t2.*
FROM agentName as t1
LEFT JOIN transPayment as t2
ON t1.agentID = t2.payID
WHERE t2.stat='FTW' AND t1.agentID = '".$_GET["agentID"]."'";
我正在尝试通过
重写它$strSQL = "SELECT t1.*, t2.*, (SUM(t2.ca_in) + SUM(t2.ca2_in)) as Total
FROM agentName as t1
LEFT JOIN transPayment as t2
ON t1.agentID = t2.payID
WHERE t2.stat='FTW' AND t1.agentID = '".$_GET["agentID"]."'";
我将如何汇总表转账中ca_in和ca2_in中的所有金额?