I have postgres table with structure:
|key| position | date | |---|----------|------------| | 1 | 5 | 2017-07-01 | |---|----------|------------| | 1 | 9 | 2017-07-02 | |---|----------|------------| | 2 | 4 | 2017-07-01 | |---|----------|------------| | 2 | 8 | 2017-07-02 |
But I need to have the selected data in a format like this:
| key | 2017-07-01 | 2017-07-02 | |-----|------------|------------| | 1 | 5 | 9 | |-----|------------|------------| | 2 | 4 | 8 |
How can I do something like this?