查询在表1中存在,在表2中不存在的记录,将其插入表2

来源:互联网 发布:韩语自学书籍 知乎 编辑:程序博客网 时间:2024/05/19 02:01
 $q="insert into 表2 select * from 表1 where not exists(select * from 表2 where 表1_id=表2_id )";   
 $r=$wpdb->get_results($q);
0 0
原创粉丝点击