SELECT COUNT(*) FROM (SELECT COUNT(*)FROM TODOSWHERE ...)
jooq.fetchCount(select().from(TODOS).where(...));
List<Integer> counts =jooq.select(count()).from(TODOS).where(...).fetch(count());
--
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+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
So, you've successfully created a "value 1 generator", as that's indeed the only value that can ever come out of that query. :-)
So, you've successfully created a "value 1 generator", as that's indeed the only value that can ever come out of that query. :-)
I wonder if I can patent this... Anyway, thank you for your answer!
--
You're welcome. Again, sorry for the confusion.
From an API user perspective, do you maybe have an idea how this could be improved? While the concrete execution of this functionality is confusing, the general idea is still useful. It would be great to have your feedback on the issue, if you have any ideas:
Sorry that I was a bit slow to answer to this.
You're welcome. Again, sorry for the confusion.
I think that this was a stupid developer problem (at least partially). For some reason I missed the created SQL query even though I read the SQL queries from my log file.
From an API user perspective, do you maybe have an idea how this could be improved? While the concrete execution of this functionality is confusing, the general idea is still useful. It would be great to have your feedback on the issue, if you have any ideas:
Well, I am sure if the current is necessarily bad. The reason why I originally used it in the wrong way was that I thought that
- I need to call the selectCount() so that I can create a count query (like I have to call select() so that I can create a SELECT query).
- fetchCount() and fetchOne() works in the same way (I need to call one of them to obtain the query results).
Also, for some reason I couldn't find a count query example from the reference manual. Does it have one?