Mark Stosberg wrote:
> 
> I'm using MySQL 3.23.32 and having trouble selecting values where a
> column is null. Any help is appreciated. An example is below:
> 
> I need to get the rows where the last_visit column in the users table is
> NULL.
> I can see that there are some with this select statement:
> (last_visit is a date field)
> 
> mysql> select user_id,screen_name,last_visit, second_to_last_visit from
> users;
> +---------+-----------------+------------+----------------------+
> | user_id | screen_name     | last_visit | second_to_last_visit |
> +---------+-----------------+------------+----------------------+
> |       1 | xxxxxx-fake     | NULL       | NULL                 |
> |       2 | xxxxxxxxxx-fake | NULL       | NULL                 |
> |       3 | xxxxx-admin     | 2001-05-24 | 2001-05-07           |
> |       4 | xxxx-admin      | 2001-05-08 | 2001-05-07           |
> |       5 | xxxxx-admin     | 2001-03-23 | 2001-03-21           |
> 
> However, if I ask for the rows where last_visit = NULL, it says there are
> not any! :
> mysql> select user_id,screen_name,password,last_visit,
> second_to_last_visit from users where  last_visit = NULL;
> Empty set (0.00 sec)
> 
Mark:

Try:

select user_id,screen_name,password,last_visit,
second_to_last_visit from users where  last_visit <=> NULL

Van
-- 
=========================================================================
Linux rocks!!!   http://www.dedserius.com
=========================================================================

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to