mysql查询,
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
显示错误:#1241-操作数应包含1列
2条答案
按热度按时间mlmc2os51#
um6iljoc2#
这是错误的:
应该是:
或: