首页 > 代码库 > oracle 按某个字段查询重复数据

oracle 按某个字段查询重复数据

 /* 手机号为重复的会员,获取其最大会员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=NAND t.mobile_state=Y   AND t.mobile=mobile                                                        GROUP BY t.mobile,t.mobile_state,t.is_delete HAVING COUNT(*)>1                                                                                    )                                ) 

 

oracle 按某个字段查询重复数据