Martijn,
thanks for your excellent mail:
Martijn Tonies wrote:
> [[...]]
>
> A column can have two states: null or not null. It either has
> data (a value, depending on the datatype), or no data (null),
> which is where IS NULL (has no data) or
> IS NOT NULL (has data) comes into play.
To ma
Well, if nothing can ever equal null, then why isn't MySQL query parser
smart enough to reduce my queries to something more sensible? If I'm
saying this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
Why isn't it able to reduce the query to something more lik
Well, if nothing can ever equal null, then why isn't MySQL query parser
smart enough to reduce my queries to something more sensible? If I'm
saying this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
Why isn't it able to reduce the query to something more like t
On Mon, Dec 28, 2009 at 5:41 PM, Carsten Pedersen wrote:
> David Giragosian skrev:
>
>> On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso
>> wrote:
>>
>> Will anything ever be equal to NULL in a SELECT query?
>>>
>>
> ...
>
> What's so special about NULL?
>>>
>>
>>
>> http://dev.mysql.com/doc/r
David Giragosian skrev:
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso wrote:
Will anything ever be equal to NULL in a SELECT query?
...
What's so special about NULL?
http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html
Should answer some of your questions, Dante.
Oddly e
Hi,
Will anything ever be equal to NULL in a SELECT query?
No, never.
Null also means "unknown", if you design your tables well enough,
there should be no NULLs -stored- (different from a resultset,
where there can be nulls, for example in LEFT JOINs), because
it's no use to store what you d
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso wrote:
>
> Will anything ever be equal to NULL in a SELECT query?
>
> SELECT *
> FROM sometable
> WHERE somecolumn = NULL;
>
> I have a real-life query like this:
>
> SELECT *
> FROM sometable
> WHERE somecolumn = NULL OR somecolumn = 'abc';
No, nothing will ever equal null. In strict relational theory, which I
don't know well enough to begin expounding on here, null does not even
equal another null. That's why SQL provides IS NULL and IS NOT NULL
as explicit cases.
- michael dykman
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorens
Will anything ever be equal to NULL in a SELECT query?
SELECT *
FROM sometable
WHERE somecolumn = NULL;
I have a real-life query like this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
The 'sometable' contains about 40 million records and in this query, i