博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

根据某个字段去重

Posted on 2019-01-23 10:22  和风细雨汪汪  阅读(157)  评论(0编辑  收藏  举报
select * from  tablename  as  a 
where not exists (select 1 from  tablename  where attachid=a.attachid and name<a.name) 

 mysql另一种去重方式

   select * from table group by name