> > Fortunately there is function COALESCE() that will return the first
argument
> > that is not NULL. In case of NULL values you can use a default value for
an
> > expression: COALESCE( `col`*2, 14) will produce 14 if `col` is NULL.
>
> FWIW, IFNULL() does the same thing, with a clearer (to me) n
On Thu, Oct 28, 2004 at 11:50:12AM +0200, Jigal van Hemert wrote:
...
> Fortunately there is function COALESCE() that will return the first argument
> that is not NULL. In case of NULL values you can use a default value for an
> expression: COALESCE( `col`*2, 14) will produce 14 if `col` is NULL.
From: "Harald Fuchs" <[EMAIL PROTECTED]>
> In article <[EMAIL PROTECTED]>,
> "Jigal van Hemert" <[EMAIL PROTECTED]> writes:
>
> > Fortunately there is function COALESCE() that will return the first
argument
> > that is not NULL. In case of NULL values you can use a default value for
an
> > expres
In article <[EMAIL PROTECTED]>,
"Jigal van Hemert" <[EMAIL PROTECTED]> writes:
> NULL is meant to indicate that the value is unknown. If a value is unknown
> it can be anything.
> So, in the example `col` <> 'blah', col can be anything, including 'blah'.
> If you take that into consideration the o
From: "Harald Fuchs" <[EMAIL PROTECTED]>
> Yes, of course. "NULL <> 'blah'" returns NULL, and that's perfectly
> standards-conformant.
Furthermore, it's quite logical.
NULL is meant to indicate that the value is unknown. If a value is unknown
it can be anything.
So, in the example `col` <> 'bla
In article <[EMAIL PROTECTED]>,
matt_lists <[EMAIL PROTECTED]> writes:
> I cant tell if this is a bug or a feature.
> Select from table where col <> 'blah'
> I use this all the time with other databases, works great, gives me
> everything that's not "blah"
If those "other databases" return also
MySQL also has a work around. You might try to rephrase your comparison as
WHERE not col <=> 'blah'
the "<=>" operator is documented as a null-enabled equality check. That
way if you are comparing null to null, you get a true or false and not
another null. This comparator is available as of 3
At 14:51 -0400 10/25/04, matt_lists wrote:
I cant tell if this is a bug or a feature.
Select from table where col <> 'blah'
I use this all the time with other databases, works great, gives me
everything that's not "blah"
but in mysql, it wont work if there's null records in the table
That is the
matt_lists wrote:
I cant tell if this is a bug or a feature.
Select from table where col <> 'blah'
I use this all the time with other databases, works great, gives me
everything that's not "blah"
In SQL (not just MySQL), any comparisons involving NULL return NULL,
so if that was working in some o
[snip]
I cant tell if this is a bug or a feature.
Select from table where col <> 'blah'
I use this all the time with other databases, works great, gives me
everything that's not "blah"
but in mysql, it wont work if there's null records in the table
I have to do this, select from table where (
10 matches
Mail list logo