请教条SQL语句distinct
select distinct count(name) from table_my
如上,为何distinct不会过滤 我查询name列有多少条,需要过滤掉重复的。
[解决办法]
select COUNT(distinct name) from table_my
[解决办法]
DISTINCT放到括号里面
发布时间: 2012-11-09 10:18:48 作者: rapoo
请教条SQL语句distinct
select distinct count(name) from table_my
如上,为何distinct不会过滤 我查询name列有多少条,需要过滤掉重复的。
[解决办法]
select COUNT(distinct name) from table_my
[解决办法]
DISTINCT放到括号里面