Hey,

I have a jooq query that SELECTs a table from a database more or less like 
so:

Select<?> query = jooq.select(<empty/unknown>).from(table)....<unknown>

Now, before executing that query I want to get the number of rows that will 
be fetched first.
I want to do this to be able to allocate space in an array/show a progess 
bar/etc..

So: Can I derive a SELECT COUNT(*) query from an *existing* select query?

What I tried so far is this:
 * Convert query to string
 * Create a new query from the string (basically create a copy)
 * Call query.getSelect().add(Factory.count()) --> seems to have no effect
----------------------
 * Create a copy as above
 * Call query.getQuery().addSelect(Factory.count())
 * While this does work with an empty select() call it does not work with 
select(<fields>) as the existing items cannot be removed

Thanks!

Reply via email to