Subject Re: [ib-support] Sum, Union and Count
Author Arno Brinkman
> The problem is when i use a "regular" sql
> select count(*) as total from clients
> where ( OR (
> interbase take too long.
> So i change the query to speed up.
> This query it´s only an example, its not the original.
> Here is the original:
> Select Count(*) Total From Cliente C,Cliente_Mailing CM ,Mailing_Campanha
> Where C.id_cliente=CM.id_cliente and CM.id_mailing=MC.id_mailing and
> MC.id_campanha in(8,20)
> This is a very slow query. I had same problems with other querys (wich
> need sum)
> where Union solve the problem.

Have you tried Count(ID) ?