jOOQ 是否支持选择查询数组?我想要如下内容:
select table.*, array(select another_table.id from another_table where ...)
from table;
我尝试使用 DSL.array(context.select(...).asField())
进行试验,但这会生成 array[(select ...)]
而不是 array(select(...))
。
最佳答案
我应该做的:
PostgresDSL.array(context.select(...))
请注意,我们正在使用 PostgresDSL
而不是通用的 DSL
并且没有将 .asField()
应用于选择,以内联内部选择查询到外部查询。
关于java - jOOQ - 选择查询数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45756951/