SQL高级应用之同服务器上复制表到另一数据库中并实现去重复
程序员文章站
2023-12-01 22:52:34
sql语句:
复制代码 代码如下:insert into whir_ezmall_full_c..whir_member(memberid, levelid, accou...
sql语句:
复制代码 代码如下:
insert into whir_ezmall_full_c..whir_member(memberid, levelid, account, memberpwd, email, integral, membername, memberstatus, sex, birthday, area, adress, zipcode, tel, mobile, savequestion, saveanswer, createdata, lastlogindata, imgurl, limitintegral, integralbegintime, integralendtime, membertype, banktype, bankregion, bankaddress, bankaccount, bankname, isqq)
select memberid, levelid, account, memberpwd, email, integral, membername, memberstatus, sex, birthday, area, adress, zipcode, tel, mobile, savequestion, saveanswer, createdata, lastlogindata, imgurl, limitintegral, integralbegintime, integralendtime, membertype, banktype, bankregion, bankaddress, bankaccount, bankname, isqq from whir_ezmall_full..whir_member
where whir_ezmall_full..whir_member.memberid not in (select memberid from whir_member)