update car set identifier = concat('MMMMMM_',substring(upper(create_by),1,4),'_000',identifier) where identifier is not null and identifier <> '' and length(identifier)=1
concat('aaa','bbb','ccc')
字符串拼接-->结果为 aaabbbccc
substring('aaabbbccc',2,4)
字符串截取---从第二位开始截取,截取4个----->结果为 aabb
upper(create_by)
字符串转换为大写,将create_by字段里的内容转换为大写
where identifier is not null
非空,当identifier字段不为空
length(identifier)=1
字段中字符串长度,identifier字段中字符串长度1
update car set identifier = concat('MMMMMM_',substring(upper(create_by),1,4),'_000',identifier) where identifier is not null and identifier <> '' and length(identifier)=1
在表car中,当identifier字段不为null并且identifier不为''并且identifier中字符串长度为1的时候,将identifier字段内容改为 'MMMMMM_' + create_by中前四位字符的大写 + '_000' + 原identifier字段内容。