假设我有
SELECT `Type`, `Originating Country Code`,`Originating Currency Code`, SUM(`Principal Amount`) as Total
FROM `colab`
WHERE (`Destination Country Code`='PH'
AND `Destination Currency Code`='PHP'
AND `Type` = 'PAID') || (`Destination Country Code`='PH'
AND `Destination Currency Code`='USD'
AND `Type`= 'PAID')
GROUP BY `Type`
工作正常并返回true,请参见下文
country_code | Currency_Code | Type | Principal
=======================================================
| PH | PHP | PAID | 200
=======================================================
我的问题是我想将货币的总本金与美元值分开。请查看我的数据库中的记录
country_code | Currency_Code | Type | Principal
=======================================================
| PH | PHP | PAID | 100
| PH | USD | PAID | 100
=======================================================