I have 2 tables :
'pay'
|id_tax|value|id_currency|
--------------------------
|1 |100 |12 |
|1 |200 |12 |
|1 |300 |13 |
|2 |200 |12 |
|2 |200 |12 |
--------------------------
'rate'
|id_currency|rate|
------------------
|12 |1 |
|13 |6,12|
------------------
What SQL query will result in this?
|id_tax|value |
-----------------------------
|1 |100*1+200*1+300*6,12|
|2 |200*1+200*1 |
-----------------------------