我有以下查询:为什么我为计数得到0([现场])当空
Select [Field], count([Field]) as Counts
from [Table_Name]
group by [Field]
结果如下所示:
[Field] [Counts]
Type1 100
Type2 100
Type3 100
Type4 100
Null 0
然而,当我在算键或任何其他字段比我分组的字段我得到[字段]空的行的实际数量。这是为什么?
Select [Field], count([Other]) as Counts
from [Table_Name]
group by [Field]
结果:
[Field] [Counts]
Type1 100
Type2 100
Type3 100
Type4 100
Null 100
+1为解释......我无法用言语表达秒。 – 2013-04-10 22:30:42