我有以下查詢:爲什麼我爲計數得到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