JOOQ insert into ... select from ... 在重复键更新时

问题描述

如何在另一个表上插入带有选择的表?

我试过了:

  dslContext.insertInto(TABLE)
                .select(select(TABLE2.val1.as("p"),TABLE2.val2)
                        .from(TABLE2).as("filtered"))
                .onDuplicateKeyUpdate()
                .set(field(TABLE.VALUE),field(name("filtered","p"),String.class))
                .execute();

但我收到一个错误 - org.postgresql.util.PsqlException: ERROR: missing FROM-clause entry for table "filtered"

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)