The db schema along with sample data is something like this -
(Country table)
| Country | Country Code |
--------------------------
ABC A
BCD B
(TransactionTable)
| SrcCountryCode | DestCountryCode| SrcCurrency| DestCurrency | SrcAmount | DestAmount |
----------------------------------------------------------------------------------------
A B X Y 200 1000
A B X Y 300 1500
B A Y X 1000 200
I want the result set to be like this -
| Corridor | Total Src Amount| Total Dest Amount | Src Currency |
-----------------------------------------------------------------
ABC-BCD 500 200 X
BCD-ABC 1000 2500 Y
I am lost on how to map the Country combinations as well as map the total amounts for destination and source subsequently in one table. Help would be appreciated.
sum. I'm writing an answer but now I'm wondering if it'll truly help...