I have a table with 3 columns, representing a matrix:
i j val
-------
1 1 1
1 2 12
1 3 4
2 1 3
2 2 4
2 3 4
3 1 0
3 2 2
3 3 2
How would I select this table in such a way i get
a1 a2 a3
-------
1 12 4
3 4 4
0 2 2
Is there a way to use pivot or what would be the best approach here?