Code 1declare@atable(id int,value1 int) 2insert@a 3select1,1unionall 4selectnull,nullunionall 5select3,nullunionall 6select5,5unionall 7select7,7 8 9selectcount(0) as a,count(1) as b,count(*) as c, count(value1) as d from@a 10
/*------------------------- a b c d 5 5 5 3 ---------------------------*/