我是SQL的新手,遇到了一些麻烦。我的剧本写得太过火了,而不是卡住了。表如下..。
表1:学生答案。栏:
表2:问题。栏:
我必须显示的问题,从来没有正确回答,并已被问至少一次(问题id=question id)。
我可以得到被错误回答的问题(学生answer<>correct回答),但没有被正确回答。我在想,如果我数了问题的数量,当这个数等于回答错误的数字时,我就不会得到正确的答案。我可能把事情复杂化了。
任何帮助都很感激。
发布于 2014-11-02 20:29:45
select *
from questions Q
where not exists (
select 1
from student_answers A
where A.question_id = Q.question_id
and A.student_answer = Q.correct_answer
);https://stackoverflow.com/questions/26703930
复制相似问题