Using MySQL. I have a table that looks like this:
rawID | a1a | a1b | a2a | a2b | a2c | ...
1 | 2 | 0 | 0 | 0 | 2 | ...
2 | 2 | 2 | 0 | 0 | 0 | ...
3 | 0 | 1 | 1 | 1 | 2 | ...
4 | 2 | 1 | 2 | 1 | 2 | ...
*The possible values for the fields are predefined in a separate "response" table and range from 0-2.
I want a result that gives me the occurence of each value for each field. I've seen similar questions as this, but only ever deal with one field.
I would like my result to look like this:
response | a1a | a1b | a2a | a2b | a2c | ...
0 | 1 | 1 | 2 | 2 | 1 | ...
1 | 0 | 2 | 1 | 2 | 0 | ...
2 | 3 | 1 | 1 | 0 | 3 | ...
This table has the number of times each value ("response") occurred for each field.
Thanks guys,