将数据行转换为类似于数据透视表的实际值

我有一个MySQL表格格式的数据

C1 | C2 | C3 (Column titles) A1 | X1 | Y1 A1 | X2 | Y2 A1 | X3 | Y3 B1 | X1 | Y4 B1 | X2 | Y5 B1 | X3 | Y6 B1 | X4 | Y7 C1 | X1 | Y8 C1 | X2 | Y9 

我想将其转换为

 00 | X1 | X2 | X3 | X4 A1 | Y1 | Y2 | Y3 | B1 | Y4 | Y5 | Y6 | Y7 C1 | Y8 | Y9 

就像一个数据透视表一样,但将Yx的实际值放在表中,而不是对它们执行操作(总和/平均等)。

是否有一个简单的方法来在MySQL或Excel / libreoffice中做到这一点?

谢谢

SQLFiddle演示

 select C1, max(case when c2='X1' then C3 else '' end) as `X1`, max(case when c2='X2' then C3 else '' end) as `X2`, max(case when c2='X3' then C3 else '' end) as `X3`, max(case when c2='X4' then C3 else '' end) as `X4` from t group by C1