SQL Server select count(distinct *)

时间:2014-12-11 17:12:12   收藏:0   阅读:158

测试表:student

select * from studnet;

bubuko.com,布布扣

select count(distinct name) from student;
bubuko.com,布布扣
select count(distinct *) from student;

bubuko.com,布布扣

这样是有错误的,可以变通的实现
select count(*) 
from
(select distinct * from student) st;

bubuko.com,布布扣

此路不通,我走另一条路!

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!