I have a table like this:
X,Y,Z,A,B,C
X,Y,Z,D,E,F
X,Y,Z,G,H,I
X,Y,W,A,C,D
X,Y,W,H,I,J
Obviously it is non-normalized table. I want a query that returns the following result:
X,Y,Z,{{A,D,G},{B,E,H},{C,F,I}}
X,Y,W,{{A,H},{C,I},{D,J}}
Normalization is very expensive.Any ideas?