以下语句查询表,该表列出了已参加“AS”培训会话的员工列表。有些员工多次参加“AS”培训,可能会多次出现在列表中。
SELECT schedule_test.ID, (COUNT(CASE WHEN schedule_test.Course LIKE 'AS%'
THEN schedule_test.Course END)) AS "AS"
FROM schedule_test
GROUP BY schedule_test.ID
我想现在添加一个WHERE语句,仅显示未参加“AS”会话的员工,或者用另一种方式显示只有0个“AS”会话的员工。我试过了:
WHERE "AS"==0 with no success.
I even tried WHERE "AS" < 1 with no success.
可以使用一些帮助。
答案 0 :(得分:1)
尝试:
HAVING count(course) < 1
在查询结束时