Skip to content

Instantly share code, notes, and snippets.

@yoshiki-0428
Created February 5, 2020 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshiki-0428/dd1048bbd0679104bc58ad7d089c5141 to your computer and use it in GitHub Desktop.
Save yoshiki-0428/dd1048bbd0679104bc58ad7d089c5141 to your computer and use it in GitHub Desktop.

jooq DateでGroupByのコード


Result<Record3<Integer, Integer, BigDecimal>> fetch1
                    = DSL.using(conn)
                            .select(DSL.year(TABLE.DATE),
                                    DSL.month(TABLE.DATE),
                                    DSL.sum(TABLE.MYBIGINT))
                            .from(TABLE)
                            .groupBy(DSL.year(TABLE.DATE), DSL.month(TABLE.DATE))
                            .orderBy(DSL.year(TABLE.DATE), DSL.month(TABLE.DATE))
                            .fetch();

https://groups.google.com/forum/#!topic/jooq-user/8K2iiyU8orY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment