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
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