截取master_major前六位 更新到master_major_code
UPDATE special_teacher_new set master_major_code = (substring(master_major,1,6))
扩展:
update table set A = concat(substring(A,1,6),'bbb'); 拼接字符串
根据其他表字段数据更新 当前表字段
update special_manager s ,static_area a
set s.area_id = a.id
where s.area_name = a.name
文章来源:刘俊涛的博客 欢迎关注公众号、留言、评论,一起学习。
__________________________________________________________________________________
若有帮助到您,欢迎点击推荐,您的支持是对我坚持最好的肯定(*^_^*)