Sql 基于具有子字符串的条件更新列值
我需要将包含Sql 基于具有子字符串的条件更新列值,sql,spring-boot,liquibase,Sql,Spring Boot,Liquibase,我需要将包含autor子字符串的列的所有值更改为author 示例:我的当前行是role autor,需要变成role author 在liquibase中可能吗?您只想replace() 是否只需要replace() 大概是这样的: <update tableName="your_table_name"> <column name="role-autor" type="varchar(64)" valueComputed="REPLACE(role-autor, 'a
autor
子字符串的列的所有值更改为author
示例:我的当前行是role autor
,需要变成role author
在liquibase中可能吗?您只想
replace()
是否只需要
replace()
大概是这样的:
<update tableName="your_table_name">
<column name="role-autor" type="varchar(64)" valueComputed="REPLACE(role-autor, 'autor', 'author')" />
<where>role-autor LIKE '%autor%'</where>
</update>
类似于“%autor%”的角色autor
请做的StackOverflow博客的研究有一些例子,可以帮助你
您需要将其放入变更集标记中:
<changeSet author="wiki" id="1.0.0-1">
<update tableName="your_table_name">
<column name="role-autor" type="varchar(64)" valueComputed="REPLACE(role-autor, 'autor', 'author')" />
<where>role-autor LIKE '%autor%'</where>
</update>
</changeset>
类似于“%autor%”的角色autor
有关变更集标记的更多详细信息,请参阅以下内容:类似的内容:
<update tableName="your_table_name">
<column name="role-autor" type="varchar(64)" valueComputed="REPLACE(role-autor, 'autor', 'author')" />
<where>role-autor LIKE '%autor%'</where>
</update>
类似于“%autor%”的角色autor
请做的StackOverflow博客的研究有一些例子,可以帮助你
您需要将其放入变更集标记中:
<changeSet author="wiki" id="1.0.0-1">
<update tableName="your_table_name">
<column name="role-autor" type="varchar(64)" valueComputed="REPLACE(role-autor, 'autor', 'author')" />
<where>role-autor LIKE '%autor%'</where>
</update>
</changeset>
类似于“%autor%”的角色autor
有关变更集标记的更多详细信息,请阅读:是的,只想使用liquibase xml stuffyeah,只想使用liquibase xml stuffyeah,只想使用autorepeat、autorun等。请注意autorepeat、autorun等。