I have a single column table, which is a list of possible values, separated by commas. I would like to request, grouped by each individual possible value.
As a test, I wrote this query:
SELECT `Please_identify_which_of_the_following_classroom_hardware_you_c2`, count(`_How_would_you_rate_your_overall_skill_in_using_educational_tec1`) as count, `_How_would_you_rate_your_overall_skill_in_using_educational_tec1` FROM `data_Copy_of_Faculty_survey_on_technology_in_the_classroom_Respo` GROUP BY `_How_would_you_rate_your_overall_skill_in_using_educational_tec1`, CASE WHEN `Please_identify_which_of_the_following_classroom_hardware_you_c2` LIKE '%Elmo%' THEN 'Elmo' END
(Please excuse column names, they are automatically generated)
I know that the CASE statement is not very useful at the moment, but I'm just trying to run a query. I get an error message:
ERROR 1064 (42000): You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use next to "THEN" Elmo "END" on line 10
Throughout life, I cannot find what is wrong with the request. Any insight would be appreciated.
EDIT: I tried with single and double quotes - the same problem, regardless of the quote used.
UPDATED: As Mark noted, even if I get this query for parsing, the results will not be what I'm looking for. I'm still wondering why this is not being parsed, but the query is not a solution to my original problem.
source share