$q=" insert into 表2 select * from 表1 where not exists(select * from 表2 where 表1 _id=表2_id )"; $r=$wpdb->get_results($q);