Subject Re: [firebird-support] Simple SQL question
Author Martijn Tonies
Hi,

> I have a rutine in which I would like to have a progressbar.

You mean, a progress bar that counts up while running this
query? Or a progress bar that proceeds while handling the
resultset of this query?

> The SQL is like this:
>
> Select
> Field1,
> Field2,
> SUM(Field3)
> from Table1
> Group by 1,2
>
> I would like to be able to count how many records there will be
> returned to me by this SQL.
>
> Can I do that ?

You would have to run it twice, I think.

select count(*) from (Select
Field1,
Field2,
SUM(Field3)
from Table1
Group by 1,2)

Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com