我有一个名为 historical_currencies_rate 的表,我保存了一些已知货币的最近8年货币汇率 . 例如(欧元兑美元) . 表看起来像这样
+---------------------------+---------------+------------+
| rate_date | currency_pair | rate |
+---------------------------+---------------+------------+
| 2006-01-01 | EUR-USD | 1.1797 |
| 2006-02-01 | EUR-USD | 1.1826 |
| 2006-03-01 | EUR-USD | 1.1875 |
| 2006-04-01 | EUR-USD | 1.2083 |
| 2006-05-01 | EUR-USD | 1.2088 |
| 2006-06-01 | EUR-USD | 1.2093 |
| 2006-07-01 | EUR-USD | 1.2093 |
| 2006-08-01 | EUR-USD | 1.2093 |
| 2006-01-01 | JPY-USD | 0.01275 |
| 2006-02-01 | JPY-USD | 0.01275 |
| 2006-03-01 | JPY-USD | 0.01275 |
| 2006-04-01 | JPY-USD | 0.01275 |
| 2006-05-01 | JPY-USD | 0.01275 |
| 2006-06-01 | JPY-USD | 0.01275 |
| 2006-07-01 | JPY-USD | 0.01275 |
| 2006-08-01 | JPY-USD | 0.01275 |
| 2006-01-01 | GBP-USD | 1.559 |
| 2006-02-01 | GBP-USD | 1.559 |
| 2006-03-01 | GBP-USD | 1.559 |
| 2006-04-01 | GBP-USD | 1.559 |
| 2006-05-01 | GBP-USD | 1.559 |
| 2006-06-01 | GBP-USD | 1.559 |
| 2006-07-01 | GBP-USD | 1.559 |
| 2006-08-01 | GBP-USD | 1.559 |
| 2006-01-01 | AUD-USD | 1.0515 |
| 2006-02-01 | AUD-USD | 1.0515 |
| 2006-03-01 | AUD-USD | 1.0515 |
| 2006-04-01 | AUD-USD | 1.0515 |
| 2006-05-01 | AUD-USD | 1.0515 |
| 2006-06-01 | AUD-USD | 1.0515 |
| 2006-07-01 | AUD-USD | 1.0515 |
| 2006-08-01 | AUD-USD | 1.0515 |
| 2006-01-02 | EUR-USD | 1.2092 |
| 2006-02-02 | EUR-USD | 1.2066 |
| 2006-03-02 | EUR-USD | 1.2061 |
| 2006-04-02 | EUR-USD | 1.2061 |
| 2006-05-02 | EUR-USD | 1.2061 |
| 2006-06-02 | EUR-USD | 1.1981 |
| 2006-07-02 | EUR-USD | 1.1973 |
| 2006-08-02 | EUR-USD | 1.1948 |
+---------------------------+---- ----------+------------+
在这里,我已向您展示了8天和2006年的几种货币数据,但我拥有18种货币的大量数据,截至2013年的数据为30天 .
我的查询是,我想要一个包含每月特定货币的平均货币汇率的数组 . 例如 1.19935 月份的 EUR-USD 的 EUR-USD 是 1.19935 , JPY-USD 是 0.01275 , GBP-USD 是 1.559 和 EUR-USD 的 EUR-USD 平均 1.2030375 等
我想要每个月的平均值 EUR-USD 或者可能是其他一些货币对,即 . 应该是这样的
`[1.19935, 1.2030375, ......]`
query-result = [avg . of EUR-USD for January, 2006 ,avg . of EUR-USD for February, 2006 ,.............,avg . EUR-USD for January, 2013 ,.....]等等长达8年 .
请帮我写一下这个问题 . 谢谢