我在wordpress中有一个表1
wp_term_relationships (
object_id bigint(20),
term_taxonomy_id bigint(20),
term_order int(11)
)
和表 2 作为
wp_test (
object_id bigint(20),
term_taxonomy_id bigint(20)
)
现在我正在尝试使用aswp_term_relationships
中的值进行更新wp_test
update ignore wp_term_relationships m1
inner join wp_test m2
on (m1.term_taxonomy_id = m2.term_taxonomy_id)
set m1.object_id = m2.object_id
但是,所有的值wp_test
都不会更新为wp_term_relationships
我什至尝试直接将值wp_test
插入wp_test_relationships
通过使用插入作为
insert ignore into wp_term_relationships(object_id, term_taxonomy_id)
select object_id, term_taxonomy_id from wp_test
但它只是更新term_taxonomy_id
对应值为 0 的值object_id
或
object_id
对应term_taxonomy_id
值为 0的值
如何将这 2 列wp_test
从wp_term_relationships