MYSQL INSERT INTO SELECT 不插入重复数据

INSERT INTO `b_common_member_count` (uid) SELECT uid FROM `b_common_member` WHERE uid NOT IN (SELECT uid FROM `b_common_member_count`)

 

把b_common_member里的uid,不重复的全部插入到b_common_member_count的uid里。

posted @ 2015-02-10 11:35  王翔(kingfly)  阅读(3591)  评论(0编辑  收藏  举报