我想用 2 个 COUNT() 列对 SQL Compact 4.0 DB 表进行查询。当特定列的十进制值大于或等于 3.0 时,第一列应计算所有行( COUNT(*) ),第二列应仅计算行
我做到了这一点:
SELECT COUNT(a.number) AS Participant, COUNT(b.specificColumn) AS Approved
FROM person AS a
LEFT OUTER JOIN test AS b
ON b.number = a.number
这样第二个 COUNT() 显然只会计算行,实际上有一个值!= NULL