使用jooq SelectQuery将计数添加为选择字段 [英] Add count as select field using jooq SelectQuery

查看:209
本文介绍了使用jooq SelectQuery将计数添加为选择字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能找到的与我的学习恶作剧有关的大多数现有帖子已过时.

Most of the existing posts I can find dealing with my learning jook are outdated.

我正在尝试动态构建,以便可以使用条件进行某些更改.我试图找到如何将COUNT(*)添加到现有字段列表中

I'm trying to build dynamically so that I can use conditions for certain changes. I'm trying to find how to add COUNT(*) to an existing list of fields

SelectQuery query = create().selectQuery();
query.addSelect(TABLE.FIELD);
// add COUNT(*)?

在动态构建查询时,我没有看到任何方法或API帮助如何执行此操作.

I'm not seeing any methods or API help on how to do this when building the query dynamically.

推荐答案

只需使用上面假设这样的静态导入:

The above is assuming a static import as such:

import static org.jooq.impl.DSL.*;

这篇关于使用jooq SelectQuery将计数添加为选择字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆