【问题标题】:How do I have a composite field set in JOOQ如何在 JOOQ 中设置复合字段
【发布时间】:2019-10-02 23:44:05
【问题描述】:

我有一个包含复合字段集的查询(我不知道该怎么称呼它,请在 cmets 中输入正确的术语,以便我可以更新)

select
    name,
    `value`
from
    docs
where
    superceded_by is null
    and doc_id = 1
    and ( name , effective_on) in (  <----- composite field set
    select
        name,
        max(effective_on)
    from
        docs
    where
        superceded_by is null
        and doc_id = 1
        and effective_on <= '2017-02-01'
    group by
        name )

我想将它转换为 JOOQ,但我似乎找不到它的等价物。我已经尝试过DSL.recordType,但它不支持in

这是上下文中的查询

http://sqlfiddle.com/#!9/514a8c7/11

【问题讨论】:

    标签: sql jooq


    【解决方案1】:

    DSL.row(DOCS.NAME, DOCS.EFFECTIVE_ON)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-22
      • 2019-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多