我向woocommerce上传了1000多种产品。我用3个选项创建了全局属性(ex1,ex2,ex3)。我想用SQL更新最新的100个产品pa_manufacturer = ex1。
我认为,这是选择属性的代码。
SELECT t.*, tt.*
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id
INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('pa_manufacturer')
AND tr.object_id IN (13860)
ORDER BY t.name ASC;
有什么想法吗?