我需要进行查询以验证:
if type_answer
is equal toMultipla Escolha
所以我只需要返回不为空的记录correct_answer_description_id
If the type_answer
is not equal to Multipla Escolha
,不要制定这个规则。
所以,我尝试这种方式:
SELECT * FROM book_unit_question
WHERE book_unit_id = 2
AND status = false
CASE WHEN type_answer = 'Multipla Escolha' THEN
correct_answer_description IS NOT NULL
但我得到:
ERROR: syntax error at or near "CASE"