[Gambas-user] Bug when executing SQL..

Benoit Minisini gambas at ...1...
Tue Aug 22 20:41:07 CEST 2006


On Tuesday 22 August 2006 20:07, Stephen Bungay wrote:
> COALESCE, like NULLIF, deals with a list of values that may or may not be
> null. In the example, if SUM(rec_payments) returns a NULL then the COALESCE
> will RETURN a zero (0).
>
>   Aside from that the SELECT is pretty straight forward. If the COALESCE is
> removed and the statement changed to read as follows;
>
> SELECT SUM(rec_payment)
> FROM tbl_salespayments
> WHERE rec_create > 1158921569;
>
>   It still returns the sum, when in fact it should return a null field.
>
> Steve.
>

You are not very clear... 

Do you want to mean that there is no problem with COALESCE, but with 
SUM(rec_payment) that returns the sum instead of a "null field"?. When you 
say "null field", do you mean the null value? How can a SUM() operator can 
return a null value?

-- 
Benoit Minisini





More information about the User mailing list