sql语句要优化,这么写的只有新手吧,
写个with()临时表
然后下面join一下,你试试也是秒查
with tb1 as
(select b.id_number
from member_info b
group by b.id_number
having count(b.id_number) > 1)
select *
from member_info a
join tb1 b on a.id_number = b.id_number
------分割线-------
select *
from (select b.*, count(b.id_number) idnum
from member_info b
group by 此处放上b表所有的字段)
where idnum > 1
------分割线2-------
select *
from member_info a
join (select *
from (select b.id_number, count(1) idnum
from member_info b
group by b.id_number)
where idnum > 1) b
on b.id_number = a.id_number