Consider this table definition in SQL
CREATE TABLE matrices (
matrix text[][] NOT NULL
);
Assuming that every matrix in this table has the same dimensions, how to write a query to transpose them?
for example:
INSERT INTO matrices VALUES
(array[['1','2','3'],
['4','5','6']]),
(array[['f','e','d'],
['c','b','a']]);
after the transpose it should look like:
{{1,4},{2,5},{3,6}}
{{f,c},{e,b},{d,a}}