Need a SQL query to update meta_key=’_price’ with value in meta_key=’_regular_price’
The reason your query doesn’t return anything fruitful is because you’re not comparing the meta_value of both of the meta_keys, you’re comparing non-numeric outcomes of meta_key = ‘x’ and meta_key = ‘y’. SELECT post_id, post_title FROM wp_posts INNER JOIN wp_postmeta ON post_id = post_id WHERE post_type=”product” AND meta_key=’_regular_price’ > meta_key=’_price’ What you want to be … Read more