Re: finding NULL records

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

Re: finding NULL records

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

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 values: TRUE, FALSE

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. The

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 is

RE: finding NULL records

2006-11-15 Thread Jerry Schwartz
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

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

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 field=NULL? Seems kind of odd. Sql

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

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:

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 tool

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

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

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

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

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 where