MySQL table is as follows
A | B1|B2|
-----------
0 | 1 |1 |
1 | 0 |1 |
1 | 0 |1 |
1 | 0 |0 |
I need to transpose my data in a table which contains only 2 columns: labels and sum of the original column contents such as
codes | sums
------------
A | 3
B1 | 1
B2 | 3
I don't handle very much MySQL syntax and I don't find the proper query. I can get the sum of the column, but I still don't understand how to transpose the column's name