/* 手机号为重复的会员,获取其最大会员id,对应的会员信息 */ SELECT * FROM MEMBER a WHERE a.member_id IN ( SELECT MAX(member_id) FROM MEMBER b WHERE b.mobile IN (SELECT mobile FROM ( SELECT t.mobile,t.mobile_state,t.is_delete FROM MEMBER t WHERE t.is_delete=‘N‘AND t.mobile_state=‘Y‘ AND t.mobile=‘mobile‘ GROUP BY t.mobile,t.mobile_state,t.is_delete HAVING COUNT(*)>1 ) )
时间: 2024-10-24 12:31:43