私が持っているとしましょう
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
=======================================================