我有以下表格架构 -
CREATE TABLE `tablename` (
`id` bigint(15) NOT NULL AUTO_INCREMENT,
`uuid` varchar(400) NOT NULL,
`pre_notif_action` varchar(30) DEFAULT '',
`pre_notif_interval` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uuid_UNIQUE` (`uuid`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1
对于现有记录,字段 pre_notif_action 和 pre_notif_interval 中的值分别为“predeactivate”和 45 -
mysql> select pre_notif_action, pre_notif_interval
from tablename
where uuid="1887826113857166800";
结果 -
+------------------+--------------------+
| pre_notif_action | pre_notif_interval |
+------------------+--------------------+
| predeactivate | 45 |
+------------------+--------------------+
当我尝试编辑时,我得到非零影响的行 -
update prepaid_account
set pre_notif_action=""
and pre_notif_interval=NULL
where uuid="1887826113857166800";
结果 -
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
但是,当我选择 -
mysql> select pre_notif_action, pre_notif_interval
from prepaid_account
where uuid="1887826113857166800";
我得到这个输出 -
+------------------+--------------------+
| pre_notif_action | pre_notif_interval |
+------------------+--------------------+
| 0 | 45 |
+------------------+--------------------+
我该如何解决这个问题?