A
A
alex88a2017-09-13 17:38:52
MySQL
alex88a, 2017-09-13 17:38:52

Add value to database fields?

There is a url_alias table. It has two fields keyword and query. How to execute a query to add the value shop/ to the keyword field? those. what would eventually happen for example shop/znachenie-kotoroe-bilo-do-etogo
But this should be done only for those fields whose query contains product_id=
I.e. you need a query like this: if the query field contains product_id=, then add shop/ in the keyword at the beginning of the line,
please tell me

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-09-13
@alex88a

update url_alias set `keyword` = concat('shop/', `keyword`) where `query` LIKE '%product_id=%'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question