将id=5以及emp_no=10001的行数据替换成id=5以及emp_no=10005,其他数据保持不变,使用replace实现,直接使用update会报错。

简介

修改数据

update titles_test set 
emp_no = replace(emp_no, 10001, 10005) where id = 5;


update titles_test set 
to_date =  NULL, 
from_date ='2001-01-01'
where to_date = '9999-01-01';
Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
原文地址:https://www.cnblogs.com/eat-too-much/p/14958058.html