Subject | Re: [ib-support] Sum, Union and Count |
---|---|
Author | Arno Brinkman |
Post date | 2002-08-08T21:09:16Z |
> The problem is when i use a "regular" sqlMC
> select count(*) as total from clients
> where (clientes.id=10) OR (clientes.id=11)
>
> 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 anddidnt
> MC.id_campanha in(8,20)
>
> This is a very slow query. I had same problems with other querys (wich
> need sum)Have you tried Count(ID) ?
> where Union solve the problem.
Regards,
Arno