Re: finding NULL records

2006-11-17 Thread mizioumt
l forum but rather to a general SQL discussion so I'll try 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 r

Re: finding NULL records

2006-11-17 Thread mizioumt
To: [EMAIL PROTECTED]; [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

Re: finding NULL records

2006-11-16 Thread Joerg Bruehe
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. Th

Re: finding NULL records

2006-11-16 Thread Joerg Bruehe
@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 valu

RE: finding NULL records

2006-11-15 Thread Jerry Schwartz
CTED]; mysql@lists.mysql.com > 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 in

Re: finding NULL records

2006-11-15 Thread mizioumt
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 i

Re: finding NULL records

2006-10-31 Thread Martijn Tonies
> 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

RE: finding NULL records

2006-10-31 Thread Jerry Schwartz
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: 86

RE: finding NULL records

2006-10-31 Thread Jay Blanchard
[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 un

Re: finding NULL records

2006-10-31 Thread Martijn Tonies
>>> 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 >> =NULL? Seems kind of odd.

Re: finding NULL records

2006-10-31 Thread Martijn Tonies
>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 ht

RE: finding NULL records

2006-10-30 Thread Jay Blanchard
[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

Re: finding NULL records

2006-10-30 Thread Chris
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 ret

Re: finding NULL records

2006-10-30 Thread Alan Nilsson
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 whe

RE: finding NULL records

2006-10-30 Thread Jay Blanchard
[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 val

finding NULL records

2006-10-30 Thread Alan Nilsson
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 for