以dml格式添加更新变更集更新值通过选择查询获取

时间:2018-11-21 08:37:35

标签: postgresql yaml liquibase

我想添加变更集以yaml格式更新表列值,并在运行时通过选择查询获取更新后的值;

UPDATE table SET groupid=(select id from group where groupname='star') WHERE studentid=(select studentid from student where name ='abc');

yaml格式

 - changeSet:
      id: 1
      author: abc
      changes:
         - update: 
             tableName: table
             columns:
               - column:
                   name: groupid
                   value: (select id from group where groupname='star')
             where: studentid=(select studentid from student where name ='abc')

但这对我不起作用

1 个答案:

答案 0 :(得分:0)

我得到了答案

- changeSet:
      id: 1
      author: abc
      changes:
         - update: 
             tableName: table
             columns:
               - column:
                   name: groupid
                   valueComputed: (select id from group where groupname='star')
             where: studentid=(select studentid from student where name ='abc')