I have a table like this:
+----+-----------+---------+
| ID | monday | tuesday |
+---+-----------+----------+
| 1 | 1,2,3,4,5 | 3,4,5,6 |
| 2 | 3,4,5 | 5,6,7 |
+----+-----------+---------+
Where monday
and tuesday
are SET type columns. Each number represents an hour of availability for the given day of the week. I want to count the number of entries that have each hour available so I can see when the most respondents are free.
For example, on monday
, 3 would have a count of 2 and for tuesday
,3 would have a count of 1. I'd like to use as few queries as possible.
I've been working on this for hours and can't figure it out. Any help would be appreciated! Suggestions on how to do this better would be appreciated too! Thanks!!