mysql语法出错。我使用内连接
使用了两个表来连接它们update wp_postmeta
set sku.meta_value=seo.`Meta Description`
From sanitaryseo AS seo
INNER JOIN wp_postmeta AS sku
ON sku.meta_value = seo.`product code`
where sku.meta_key='_yoast_wpseo_metadesc'
答案 0 :(得分:2)
您应该在顶部
中定义表格和连接update wp_postmeta sku
inner join sanitaryseo seo ON sku.meta_value = seo.`product code`
set sku.meta_value=seo.`Meta Description`
where sku.meta_key='_yoast_wpseo_metadesc';
请记住,Update子句不使用from ..(表或连接的表在update子句中)
答案 1 :(得分:1)
试试这个
UPDATE wp_postmeta t1
INNER JOIN wp_postmeta t2
ON t1.meta_value = t2.`product code`
SET t1.meta_value=t2.`Meta Description`
WHERE t1.meta_key='_yoast_wpseo_metadesc';