On Wed, Mar 21, 2001 at 02:36:02PM +0100, Peter Szekszardi wrote:
> I have a database which has a text field (let's name it title). The field
> is NULL initially. Now I have about a hundred thousand records in the db,
> where the title field is NULL. I have to fill these NULL title fields with
> the appropriate data, so I have to select them one-by-one, calculate the
> title field, and update the data. So my query would be:
> SELECT * FROM table WHERE title = NULL LIMIT 1;
WHERE title IS NULL
You can't use = with NULL, if you do that, you're really saying,
"where the title is the same as some unknown value," which doesn't
make sense - or at least, can't be evaluated.
> But it does not work. One of you wrote, that NULL is not equal with
> anything, not even with NULL. Could you please help me, what kind of
> select should I write in situations like this? In this particular case, I
> will do find a workaround, but I am curious, how to handle NULL values.