List:General Discussion« Previous MessageNext Message »
From:Chris Knipe Date:April 14 2005 9:23am
Subject:Re: update ... where col is null problem.
View as plain text  
I use = 0.  It works for me.


--
Chris.

I love deadlines. I especially love the whooshing sound they make as they 
fly by..." - Douglas Adams, 'Hitchhiker's Guide to the Galaxy'

----- Original Message ----- 
From: "Emil Wilmanski" <emilus@stripped>
To: <mysql@stripped>
Sent: Thursday, April 14, 2005 11:19 AM
Subject: update ... where col is null problem.


> Hi...
>
> I have problem with update query. Select query with the same "where" is
> OK.
>
> mysql> select AcctStartTime,AcctSessionTime from radacct where
> AcctStopTime is null;
> +---------------------+-----------------+
> | AcctStartTime       | AcctSessionTime |
> +---------------------+-----------------+
> | 2005-04-11 12:16:19 |          191154 |
> | 2005-04-13 06:51:59 |           37984 |
> | 2005-04-13 16:28:51 |            3617 |
> | 2005-04-13 17:36:57 |           16279 |
> | 2005-04-13 17:37:01 |           16280 |
> | 2005-04-13 17:37:03 |           16279 |
> | 2005-04-13 22:15:41 |               0 |
> | 2005-04-13 22:15:56 |               0 |
> | 2005-04-13 22:23:55 |           44018 |
> | 2005-04-14 10:34:14 |               0 |
> +---------------------+-----------------+
> 10 rows in set (0.00 sec)
>
> but update:
>
> mysql> update radacct set AcctStopTime=null where AcctStopTime is null;
> Query OK, 0 rows affected (0.00 sec)
>
> I know that this update query is stupid byt it is only to show problem.
>
> this is more/less my table:
>
> mysql> desc radacct;
>
> +--------------------+-------------+------+-----+---------------------+----------------+
> | Field              | Type        | Null | Key | Default             |
> Extra          |
>
> +--------------------+-------------+------+-----+---------------------+----------------+
> | RadAcctId          | bigint(21)  |      | PRI | NULL                |
> auto_increment |
> | AcctStartTime      | datetime    |      | MUL | 0000-00-00 00:00:00 |
> |
> | AcctStopTime       | datetime    |      | MUL | 0000-00-00 00:00:00 |
> |
> | AcctSessionTime    | int(12)     | YES  |     | NULL                |
> |
>
>
> my sql system/version:
> debian/mysql 4.1.11
>
>
> -- 
> Emil Wilmanski <emilus@stripped>
> Galeria-M
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
> 

Thread
update ... where col is null problem.Emil Wilmanski14 Apr
  • Re: update ... where col is null problem.Chris Knipe14 Apr