mysql查询除开id不同的重复数据

select * from test1 a where (a.phone,a.name) in (

select phone,name from test1 group by phone,name having count(*)>1

) and id not in (

select max(id) from test1 group by phone,name having count(*)>1

);

posted @ 2022-09-03 14:36  在线电影制作人  阅读(5)  评论(0)    收藏  举报  来源