我收到一个错误,说明在预期条件的上下文中指定了非布尔类型的表达式,该语句有什么问题?
CASE WHEN (TEAR.REASONS_FOR_TEARDOWN IN (21,17)
AND (SELECT COUNT(ELEMENTNAME)
FROM EINSPECTION_TABLE T
INNER JOIN EINSPECTION_MAIN M
ON T.ELEMENTID=M.ELEMENTID
WHERE ELEMENTTYPE = 'TD'
AND ENGINEID=1650
AND STATUS IN (1126,1127))>1)
THEN 'YC'
答案 0 :(得分:0)
您需要/stuff
end
表达式。可选择包含case
。
else
答案 1 :(得分:-1)
情况(TEAR.REASONS_FOR_TEARDOWN IN('21','17')
此外,您需要一个案例的结束语句