Subject Re: [firebird-support] Re: Problemas with SUM()
Author João Nelson
Hi Svein,

Thank you, but, your query is equal my query. on result =) The Probleman is
when I SUM NULLs. for exemplo:
SUM(Cod) but field Cod is empoty then even I put command -> WHERE COD IS NOT
NULL it execute return NULL. It´s the Problem =/

Thank you everyone


----- Original Message -----
From: "Svein Erling" <svein.erling.tysvaer@...>
To: <firebird-support@yahoogroups.com>
Sent: Friday, June 27, 2003 7:32 PM
Subject: [firebird-support] Re: Problemas with SUM()


> > > If you want to exclude NULLs, do:
> > >
> > > select sum(mycol)
> > > from table
> > > where mycol is not null>
>
> > Thank you,
> > But, I can not make it. My Quary is:
> >
> > Select IL.Quantidade-Sum(IC.Quantidade)
> > From ItensLista IL left join ItensComprados IC on
> > (il.codproduto=ic.codproduto and il.codlista=ic.codlista)
> > left join Produtos p on (IL.CodProduto=P.CodProduto)
> > Where il.CodLista = :PARAM
> > Group by IL.Quantidade
>
> Yes, you can. Change your query to
>
> Select IL.Quantidade-Sum(IC.Quantidade)
> >From ItensLista IL left join ItensComprados IC on
> (il.codproduto=ic.codproduto and il.codlista=ic.codlista and
> ic.quantidade is not null)
> left join Produtos p on (IL.CodProduto=P.CodProduto)
> Where il.CodLista = :PARAM
> Group by IL.Quantidade
>
> HTH,
> Set
>
>
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/6/2003