I have a MySQL Table as follows:
+----+-------+-------+-------+-------+-------+
| ID | MON | TUE | WED | THU | FRI |
+----+-------+-------+-------+-------+-------+
| 0 | Bike | Bike | Walk | Bike | Car |
| 1 | Car | Car | Car | Bus | Car |
| 2 | Bus | Train | Bus | Bus | Train |
| 3 | Car | Car | Car | Walk | Car |
+----+-------+-------+-------+-------+-------+
How would I group by and count all days, to get the total modes of each transport over the week. For example:
+--------+-------+
| MODE | COUNT |
+--------+-------+
| Bike | 3 |
| Bus | 4 |
| Car | 9 |
| Train | 2 |
| Walk | 2 |
+--------+-------+
I have tried using:
SELECT COUNT(*), Mon
FROM transport
GROUP BY Mon, Tue, Wed, Thu, Fri
But this creates a new group for each unique value in each day.