Count entries in enum field

I have entered survey data into a MySQL database. I have built reports to process much of the data, but I'm stuck on the best way to handle some enum fields.

I have four fields called Type1, Type2, Type3, Type4.
Type1 has the values "Full-time" & "Part-time"
Type 2 has "Solo" & "Group"
and so on.

I want to do a count query to return a report to tell me how many responded Full-time, Part-Time, Solo, Group, and so on for each option of each enum field.

I know I can do a separate query for each option of each field, but there has to be a more efficient way.
Who is Participating?
hernst42Connect With a Mentor Commented:
You can do it in one way, but if it is faster, I dont know. Its done like:
  count(if(Type1='Full-time', 1, null)) as FullTime,
  count(if(Type1='Part-time', 1, null)) as PartTime,
FROM Table
RKFcomputersAuthor Commented:
Thanks ... that's doing the trick.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.