Product Name Product Id Product Status
A 1 Rollout
A 1 Storage
A 1 Delivered
A 5 Storage
B 2 Rollout
C 3 Rollout
A 4 Rollout
A 5 Rollout
B 6 Rollout
C 7 Rollout
在上表中,我想写下面的查询,它应该返回类似的结果
Product Name QOH
A 1
B 0
C 0
询问:
SELECT Product Name, Count(Product Id)
FROM table_t1
WHERE Product Status IN ('Storage') AND Product Status NOT IN ('Delivered')
但是上面的查询返回以下结果
Product Name QOH
A 2
B 0
C 0
请帮忙。