View Single Post

  #18 (permalink)  
Old 05-15-2007
subtenante
 
Posts: n/a
Default Re: many (empty) fields or many entries?

On Mon, 14 May 2007 22:02:24 +0100, "Paul Lautman"
<paul.lautman@btinternet.com> wrote:

>I'm amazed that you would say it that way round. I have only ever had one
>application where COALESCE was useful. NULLs however are usefule for many
>things as well as many functions (IFNULL(), IF(), ...)


Yes, that's why i say COALESCE is useful only when you have NULLs !
You wouldn't think to put NULLs in your field definition only to be
able to use COALESCE.

> But to sugges that just because a field is NULL, COALESCE becomes quite
> useful is rather unbelieveble.


That wasn't my intention ! What i wanted to suggest is that COALESCE
is never useful on NOT NULL fields, and you might not make a field
possibly NULL just because of COALESCE.

> On 14 May 2007 06:38:16 -0700, Captain Paralytic
> <paul_lautman@yahoo.com> wrote:
>
>> Quite useful for functions such as COALESCE though.


Reading your sentence, i understood it as "NULLs are useful for
COALESCE function", but in my mind it is the other way : COALESCE (and
IFNULL, and all the others crafted for fields being possibly NULL) are
only a help when you need to use NULLs, but not an argument on why you
should or should not define a field as NULL or NOT NULL.

I think we agree on the principal anyways. Sorry if i misunderstood
your first message.
Reply With Quote