'where 子句 [MySQL] 中的未知列 '"'
Unknown column '"' in 'where clause [MySQL]
我收到此错误 Erreur SQL (1054):'where clause'[= 中的未知列 'pk.post_id' 19=] 当我尝试执行此查询时。
UPDATE `wp_posts` as pm
SET pm.post_content =
(select meta_value from `wp_postmeta` as pk where pk.post_id = pm.id and pk.meta_key = "_job_description")
WHERE pm.id = pk.post_id;
我没有找到解决方法。你能帮我吗?
您必须使用多个-table更新语法:
UPDATE `wp_posts` as pm
JOIN `wp_postmeta` as pk ON pm.id = pk.post_id
AND pk.meta_key = '_job_description'
SET pm.post_content = pk.meta_value;
我收到此错误 Erreur SQL (1054):'where clause'[= 中的未知列 'pk.post_id' 19=] 当我尝试执行此查询时。
UPDATE `wp_posts` as pm
SET pm.post_content =
(select meta_value from `wp_postmeta` as pk where pk.post_id = pm.id and pk.meta_key = "_job_description")
WHERE pm.id = pk.post_id;
我没有找到解决方法。你能帮我吗?
您必须使用多个-table更新语法:
UPDATE `wp_posts` as pm
JOIN `wp_postmeta` as pk ON pm.id = pk.post_id
AND pk.meta_key = '_job_description'
SET pm.post_content = pk.meta_value;