sql 根据某个字段进行去重
select * from tablename as a
where not exists (select 1 from tablename where attachid=a.attachid and name<a.name)
本文介绍了一种使用SQL查询去除重复记录的方法,通过一个字段来筛选唯一记录,适用于数据库管理及数据清洗场景。
sql 根据某个字段进行去重
select * from tablename as a
where not exists (select 1 from tablename where attachid=a.attachid and name<a.name)
3万+
3822
5468

被折叠的 条评论
为什么被折叠?