2015-06-17 33 views
1

我需要在liquibase中運行下面的更新查詢,但我不確定語法。任何人都可以請幫助:在liquibase中更新查詢

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

回答

1

試試這個

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

它拋出的錯誤:元素的內容必須包含合式的字符數據或標記。 – fiddle

+0

@ravikiran你可以發佈你的整個代碼..錯誤可以在其他地方..更新根據您的上述查詢格式是相同的,我發佈在這裏。 – Sachu

+0

忽略我之前的評論......它工作正常。萬分感謝。 – fiddle