mysql将一张表插入另一张表,去重复

往A表中插入A表中不存在uid,A表的中的uid 是B表的外键

insert into A(hid,uid) select 491,id from user where id not in (select uid from A where hid=491);

猜你喜欢

转载自blog.csdn.net/weixin_45131345/article/details/106721122