I have many fields in a column with a name starting with field_t and I have to change them to field_c
Examples of renaming:
field_t_detail should be field_c_detail
field_t_title should be field_c_title
field_t_id should be field_c_id
...
Here is the UPDATE statement for changing the name of one of the fields:
UPDATE my_table SET name = field_c_meta WHERE name LIKE 'field_t_meta';
How can I change all the fields that follow this pattern instead of doing it in a one by one basis?
How about using the
REPLACEfunction. Does it helps you?REPLACE SYNTAX
REPLACE SYNTAX