1.精准修改某一条数据的值
update 表名 set 字段 = replace(字段,'要修改的值','修改后的值') where 字段 ='条件'
需求:把orders表中的第一条数据,order_num字段的值,‘1’修改为‘2’
update Orders set order_num = replace(order_num,'1','2') where cust_id ='1000000001'
2.替换某一字段所有的值
需求:把orders 表,字段order_num 字段的值包含数字‘3’的全部替换为‘6’
update 表名 set 字段 = replace(字段,'要修改的值','修改后的值') where 字段 like '条件'
update Orders set order_num = replace(order_num,'3','6') where cust_id like'10000%'