select * from crm_customer
WHERE id in (
select id from chongfu
)
AND id NOT IN (
select id from chongfumin
) order by phone_no
;
update crm_customer set del_flag=1
WHERE id in (
select id from chongfu
)
AND id NOT IN (
select id from chongfumin
) order by phone_no
;
insert into chongfumin
select * from crm_customer where id in (
SELECT
min(id)
FROM
crm_customer
GROUP BY
phone_no
HAVING
count(phone_no) > 1
);
insert into chongfu
select * from crm_customer where phone_No in
SELECT
phone_no
FROM
chongfu
GROUP BY
phone_no
HAVING
count(phone_no) > 1
近期评论