mysql字段指定位置插入字符串

update  security_user set birthday=  CONCAT(left(birthday,4),'-',right(birthday,LENGTH(birthday)-4))  where LENGTH(birthday)=8 ;
update  security_user set birthday=  CONCAT(left(birthday,7),'-',right(birthday,LENGTH(birthday)-7))  where LENGTH(birthday)=9 ;

你可能感兴趣的:(数据库)