我正在尝试设置此 SQL 语句,当查询计数为空或空白时将返回零值。
SELECT NAME,
CASE
WHEN COUNT(question1) IS NULL THEN 0
ELSE COUNT(question1)
END
FROM INQUIRY2
GROUP BY name,
question1
HAVING Question1 = 'Yes'
AND Name IN ( 'person1', 'person2' )