如果post\\u类型产品没有缩略图,我正在尝试更新menu\\u顺序。。。已尝试:
UPDATE phiz_posts SET menu_order = 1 WHERE ID IN (SELECT ID FROM phiz_posts LEFT JOIN phiz_postmeta ON phiz_posts.ID = phiz_postmeta.post_id AND phiz_postmeta.meta_key = \'_thumbnail_id\' WHERE post_type=\'product\' AND phiz_postmeta.post_id IS NULL)
错误:无法为FROM子句中的更新指定目标表“phiz\\u posts”
此sql返回没有正确缩略图的产品ID列表:
SELECT ID FROM phiz_posts LEFT JOIN phiz_postmeta ON phiz_posts.ID = phiz_postmeta.post_id AND phiz_postmeta.meta_key = \'_thumbnail_id\' WHERE post_type=\'product\' AND phiz_postmeta.post_id IS NULL
如何改变这一点?
最好的