case batch_manager when ‘X’ then ‘是’ when ‘N’ then ‘否’ end as batchManager
在查询字段username前后加号
SELECT realname ‘姓名’,'‘+username+’*’ as ‘工号’ FROM t_s_base_user where username like ‘m%’;
修改替换字符串中包含 某段字符 的字段
update part_info set line_num=replace(line_num,‘upload/’,‘’) where part_id=‘207000064’;
mysql向表中某字段后追加一段字符串:
update table_name set field=CONCAT(field,‘’,str);
mysql 向表中某字段前加字符串:
update table_name set field=CONCAT(‘str’,field)
– mysql 替换其他表值
UPDATE target_table AS t, temp_table AS s
SET t.field_value = s.field_value
WHERE t.id = s.id;