This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 今日问题2,如何用sql语句的得到一个表中,某个字段所有不同值的个数,谢谢
-oceandeep(北极熊·戟兵);
2003-11-13
(#1463564@0)
-
select <column name>, count(<column name>) from <table name> group by <column name>?
-quattro(全轮驱动);
2003-11-13
(#1463569@0)
-
对不起,语文不好,我指的是不同值的个数,下面有答案了,谢谢
-oceandeep(北极熊·戟兵);
2003-11-13
(#1463664@0)
-
select count(distinct column_name) from table_name
-luwp(Man);
2003-11-13
(#1463580@0)
-
我以前试过 count(distinct(column name))出错后,我就没再试了,原来不要括号就对了:)谢谢
-oceandeep(北极熊·戟兵);
2003-11-13
(#1463667@0)