php - SQL Updating all mistyped entries on the same table while performing a query -


a little guys, have table named products following fields

[products] pid name category 

problem there lots of erroneous entries under category refers same category.

example of erroneous categories:

bags , wallet bags , wallets bag , walles bags & wallets 

correct 1 should bags & wallets

i want change using single sql statement subquery

update products set category = 'bags & wallets' products  category = (select category products category 'bags , wall') 

you can implement mysql's regexp searching:

update products set category = 'bags & wallets' products  category regexp 'bags? , wall' 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -