S
S
Stanislav Shabalin2020-05-27 21:05:23
MySQL
Stanislav Shabalin, 2020-05-27 21:05:23

How to update key names by condition via SQL query?

Tell me, pliz, how can I change the name of the meta key in the table?
I work with a database on Wordpress.
The `wp_postmeta` table has the following columns: meta_id, post_id, meta_key, meta_value
Condition: for all posts where the condition `meta_key` = '_price' AND `meta_key` = 'convert_to_rub' is met -> change '_price' to '_euro_price'.
I thought that I could automatically create duplicates of '_euro_price' from '_price' , and then clear '_price' , but it seems even more difficult to me.
This is necessary in order to remake the current algorithm for the formation of ruble prices from euros at the current exchange rate.
I have not come across anything like this and therefore I turn to the community. thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2020-05-28
@wppanda5

Is this about woocommerce?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question