Posts

Showing posts with the label find-in-set

mysql query showing error: #1241 - Operand should contain 1 column(s)

mysql query showing error: #1241 - Operand should contain 1 column(s) Mysql query, SELECT qcat.name, COUNT( CASE WHEN qas.state = "todo" THEN 1 END ) AS gtotal, COUNT( CASE WHEN qas.state = "gradedright" THEN 1 END ) AS rightanswer, COUNT( CASE WHEN qas.state = "gradedwrong" THEN 1 END ) AS wronganswer, SUM(qas.fraction) AS grade, quiza.id FROM mdl_quiz_attempts quiza JOIN mdl_question_attempts qa ON qa.questionusageid = quiza.uniqueid JOIN mdl_question_attempt_steps qas ON qas.questionattemptid = qa.id JOIN mdl_question qstn ON ( qa.`questionid` = qstn.id ) JOIN mdl_question_categories qcat ON ( qstn.`category` = qcat.id ) WHERE quiza.id=1173 and FIND_IN_SET(qstn.id, (1,2,3,4,5,6)) GROUP BY quiza.id,qcat.name showing error: #1241 - Operand should contain 1 column(s) Try replace FIND_IN_SET(qstn.id, (1,2,3,4,5,6)) with FIND_IN_SET(qstn.id, 1,2,3,4,5,6) (remove parenthesis) – Felippe Duarte J...