日期:2014-05-17  浏览次数:20557 次

关于mysql中distinct的用法?
在使用distinct时,如需要返回两个或者多个字段时,需要注意?
------解决方案--------------------
哦,这个都一样的,

比如一个字段:

select distinct xxx from tb

如果是2个字段:

select distinct xxx,yyy from tb
------解决方案--------------------
顶楼上
select distinct xxx,yyy from tb。
如果两条记录的XXX,YYY完全相等时才会被去重