多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
下面将通过两种方式来实现: 将 表A 与 表B 不重复的User信息 插入表B ## 方法1:Merge Into ~~~ MERGE INTO Table A USING Table B ON (A.user_id = B.user_id) WHEN NOT MATCHED THEN INSERT VALUES (B.user_id, B.user_name, B.user_sex); ~~~ ## 方法2: Not Exists ~~~ INSERT INTO Table (Id,Name,Sex) SELECT id,name,sex FROM Table A WHERE User_Id = ' Uid ' AND NOT EXISTS ( SELECT * FROM Table B WHERE A.MI_NO=B.MI_NO ) ~~~