当前位置: 代码迷 >> Sql Server >> 关于mysql中distinct的用法?该怎么解决
  详细解决方案

关于mysql中distinct的用法?该怎么解决

热度:39   发布时间:2016-04-24 18:59:45.0
关于mysql中distinct的用法?
在使用distinct时,如需要返回两个或者多个字段时,需要注意?
------解决方案--------------------
哦,这个都一样的,

比如一个字段:

select distinct xxx from tb

如果是2个字段:

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