select count distinct from group

6 views
Skip to first unread message

James Cowan

unread,
Mar 23, 2018, 8:34:43 AM3/23/18
to jOOQ User Group

Hi

I posted this question on stackoverflow before I realises there was a JOOQ google group


How do would turn this sql

SELECT DISTINCT COUNT(*) OVER () AS TotalRecords FROM table GROUP BY column


into a JOOQ query?


This is how I would do a simple count query in JOOQ:

Record record = jooq.select( TABLE.COLUMN.count() ).from( TABLE).fetchOne();

return record.into( Long.class );

Is it possible to express the "DISTINCT COUNT(*) OVER () AS TotalRecords" in JOOQ syntax?


James

Lukas Eder

unread,
Mar 23, 2018, 9:01:58 AM3/23/18
to jooq...@googlegroups.com
Thanks for your message. I'll answer on Stack Overflow

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages