当前位置: 代码迷 >> Sql Server >> 请问条SQL语句distinct
  详细解决方案

请问条SQL语句distinct

热度:54   发布时间:2016-04-25 01:18:11.0
请教条SQL语句distinct
select distinct count(name) from table_my

如上,为何distinct不会过滤 我查询name列有多少条,需要过滤掉重复的。

------解决方案--------------------
select COUNT(distinct name) from table_my
------解决方案--------------------
DISTINCT放到括号里面
  相关解决方案