当前位置: 数据库>sqlserver
SQL高级应用之同服务器上复制表到另一数据库中并实现去重复
来源: 互联网 发布时间:2014-10-13
本文导语: 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,...
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)