1、查询表ddt中 name 字段重复值
select id from ddt A where exists ( select id from ddt B where B.name=A.name and B.ID<A.ID)
博客给出了查询表ddt中name字段重复值的SQL语句,通过子查询和exists关键字,筛选出存在重复name且ID较小的记录,以获取重复值相关信息。
1、查询表ddt中 name 字段重复值
select id from ddt A where exists ( select id from ddt B where B.name=A.name and B.ID<A.ID)

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