sql 根据某个字段进行去重
select * from tablename as a
where not exists (select 1 from tablename where attachid=a.attachid and name<a.name)
sql 根据某个字段进行去重
select * from tablename as a
where not exists (select 1 from tablename where attachid=a.attachid and name<a.name)