skip to Main Content

Error in the mysql syntax .I have used two tables to join them using inner join

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' 

2

Answers


  1. You should define the table and the join in top

    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'; 
    

    And remember that Update clause don’t use from .. (the table or the tables joined are in update clause)

    Login or Signup to reply.
  2. Try this

     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'; 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search