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
Post a Comment