iso4127_code | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
JPY | 0.009613 | 0.009792 | 0.009778 | 0.009757 | 0.009827 | 0.009790 | 0.009829 | 0.009717 | 0.009346 | 0.009262 | 0.008606 | 0.008375 |
I need to unpivot so that I get a table that is:
iso4127_code | month | rate |
---|---|---|
JPY | 1 | 0.009613 |
JPY | 2 | 0.009792 |
... |
select iso4127_code, unnest(array[1,2,3,4,5,6,7,8,9,10,11,12]) as month, unnest(array[jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]) as rate from table
No comments:
Post a Comment