Update query in liquibase

2.6k views Asked by At

I need to run the below update query in liquibase, but I am not sure about the syntax. Can anyone please help:

update xyz.users
set email = (select CONCAT(username, '@gmail.com ') "email"
from xyz.users )
where email like '%@yahoo.com%'   ;
1

There are 1 answers

3
Sachu On BEST ANSWER

try this

<update tableName="xyz.users">
    <column name="email" valueComputed="(select CONCAT(username, '@gmail.com ') 
from xyz.users)"/>
<where>email like '%@yahoo.com%'</where>
</update>