UPDATE P
SET P.post_type = 'banner-slide'
FROM `berwickr_wordpress.wp_posts` AS P
INNER JOIN berwickr_wordpress.wp_term_relationships AS T
ON P.ID = T.object_id
WHERE T.term_taxonomy_id = 3
出现此错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM berwickr_wordpress.wp_posts AS P INNER JOIN berwickr_wordpress.wp_term_rel' at line 3
snytax错误在哪里?
答案 0 :(得分:1)
UPDATE
不使用FROM
。试试这个:
UPDATE berwickr_wordpress.wp_posts AS P
INNER JOIN berwickr_wordpress.wp_term_relationships AS T
ON P.ID = T.object_id
SET P.post_type = 'banner-slide'
WHERE T.term_taxonomy_id = 3
编辑:额外的OP反推(* _ *)