View Single Post
  #2   IP: 204.45.15.210
Old 2015-12-19, 11:10 PM
Purchase Purchase is offline
初级会员
 
Join Date: 2010-05-31
Posts: 1
Purchase 现在声名狼藉
Default

Change table_name and field to match your table name and field in question:
Code:
UPDATE table_name SET field = REPLACE(field, 'children eyeglasses', 'kids glasses') WHERE INSTR(field, 'children eyeglasses') > 0;

INSTR (ori_str, sub_str):
ori_str The string to be searched.
sub_str The string to be searched for within the ori_str

MySQL INSTR() takes a string and a substring of it as arguments, and returns an integer which indicates the position of the first occurrence of the substring within the string.
Reply With Quote