yongyitian 发表于 2013-1-4 01:52 
/* method 1 */
proc sql;
select distinct(markettype) as mtype, count (markettype)
谢谢!我试了一下,用以下两个程序也可以得到正确的结果:
1)proc sql;
select markettype, count (markettype)
from info
group by markettype;
quit;
2)proc sql;
select distinct(markettype) as mtype, count (*)
from info
group by mtype;
quit;
请问,count(*)和count(markettype)有什么区别吗?还有,您的第一个程序中为什么加了“distinct”?在什么情况下要加?谢谢啦!