我需要在yaml文件中添加一个变更集,以替换特定表中的子字符串 我创建了查询
update A set name= replace(name, 'first', 'test') where class_id in(select id from test_class and class in ('first','second'));
当我执行查询时,它工作正常 为此,我在yaml中创建了变更集
- changeSet:
id: q
author: abc
comment: test
preConditions:
- onFail: MARK_RAN
- sqlCheck:
expectedResult: 2
sql: select count(*) from A where template_name in ('first','second' )';
changes:
- update:
columns:
- column:
name: name
value: replace(name, 'first', 'test')
tableName: A
where: class_id in(select id from test_class where class in ('first','second'))
但是它对我不起作用,它使用文本'replace(name,'first','test')'更新了name列的值 但是我想在执行功能后更新它,即先用test替换name列值。