]; [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Wed, 15 Nov 2006 3:04 PM
Subject: RE: finding NULL records
The result of all but two expressions will be NULL (not 0 or 1) if
either
side is NULL. The two exceptions are the operators IS NULL and IS NOT
NULL.
SELECT NULL = NULL; /* result
not to comment on that anymore.
Thanks,
Michael
-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thu, 16 Nov 2006 2:55 PM
Subject: Re: finding NULL records
Hi all,
may I propose some slight corrections in wording
@lists.mysql.com
Subject: Re: finding NULL records
[[...]]
This is what happens when one of the most innovative concepts of SQL
gets overlooked
or understressed which it seems to be in most modern SQL books.
The thing is that SQL's logic isn't binary. Rather it's built over
three values: TRUE, FALSE
Hi all,
I have to follow-up to myself, as I forgot one important thing:
Joerg Bruehe wrote:
[[...]]
so in SQL for *any* comparison operator op ( =... LIKE ... )
and *any* known (= non-NULL) value x (column, literal, expression, ...)
the result of
x op NULL
is UNKNOWN.
The
trying to revive an old thread for fun...
I inherited a system in which the code was writing the string NULL
into
a
CHAR field.
This is what happens when one of the most innovative concepts of SQL
gets overlooked
or understressed which it seems to be in most modern SQL books.
The thing is
Subject: Re: finding NULL records
trying to revive an old thread for fun...
I inherited a system in which the code was writing the
string NULL
into
a
CHAR field.
This is what happens when one of the most innovative concepts of SQL
gets overlooked
or understressed which it seems
Of course this will return an empty set because you have only selected
the test_id, try this;
SELECT * FROM tests WHERE test_id IS NULL
Empty set empty column
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle
MS SQL Server
Upscene Productions
SELECT * FROM tests WHERE test_id IS NULL
Yes, that works, but I was also trying SELECT * instead of just the
key
field (just a typo in the example). The problem was in the equal sign
versus the 'IS' operator. Any reason why MySQL does not honor
field=NULL? Seems kind of odd.
Sql
[snip]
And the reason for that is because nothing is actually equal to NULL.
For a field to be equal to NULL it would actually have to contain NULL,
in which case it would not be actually NULL.
What?
NULL doesn't equal NULL because NULL means unknown.
A column can have 2 states: known or
I inherited a system in which the code was writing the string NULL into a
CHAR field. It took me a long time to figure out what MySQL CLI was showing
me.
These kids today...
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX:
I inherited a system in which the code was writing the string NULL into
a
CHAR field. It took me a long time to figure out what MySQL CLI was
showing
me.
These kids today...
Oh my, sounds like a candidate for www.thedailywtf.com :-)
Martijn Tonies
Database Workbench - development tool
I am trying to find records where the value of a filed is NULL. I
know that there are records that have null values but the result is
always an empty set.
eg:
select test_id from tests where test_id=NULL
always returns an empty set when there are in fact records that have
a null value
[snip]
I am trying to find records where the value of a filed is NULL. I
know that there are records that have null values but the result is
always an empty set.
eg:
select test_id from tests where test_id=NULL
always returns an empty set when there are in fact records that have
a null
On Oct 30, 2006, at 3:27 PM, Jay Blanchard wrote:
[snip]
I am trying to find records where the value of a filed is NULL. I
know that there are records that have null values but the result is
always an empty set.
eg:
select test_id from tests where test_id=NULL
always returns an empty set
Alan Nilsson wrote:
On Oct 30, 2006, at 3:27 PM, Jay Blanchard wrote:
[snip]
I am trying to find records where the value of a filed is NULL. I
know that there are records that have null values but the result is
always an empty set.
eg:
select test_id from tests where test_id=NULL
always
[snip]
Alan Nilsson wrote:
On Oct 30, 2006, at 3:27 PM, Jay Blanchard wrote:
[snip]
I am trying to find records where the value of a filed is NULL. I
know that there are records that have null values but the result is
always an empty set.
eg:
select test_id from tests where
16 matches
Mail list logo