我在Truncated incorrect INTEGER value: 'D'
尝试运行以下查询时收到警告:
UPDATE MESSAGES
SET status = CASE
WHEN
(from_id='111111111' AND status='A') THEN 'S'
WHEN
(to_id ='111111111' AND status='A') THEN 'R'
WHEN
((from_id ='111111111' AND status='R') OR
(to_id ='111111111' AND status='S')) THEN 'D'
END
WHERE primary_key = '236499681204'
AND
(CASE
WHEN
(from_id='111111111' AND status='A') THEN 'S'
WHEN
(to_id ='111111111' AND status='A') THEN 'R'
WHEN
((from_id ='111111111' AND status='R') OR
(to_id ='111111111' AND status='S')) THEN 'D'
END) is not null
我已经阅读了MySQL 'Truncated wrong INTEGER value'和MYSQL Truncated wrong INTEGER value error的帖子。但它们不适用于我的情况。在这里,status
是类型VARCHAR(1)
。
有什么我想念的吗?
编辑
这是创建表的查询:
CREATE TABLE `MESSAGES` (
`primary_key` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
`from_id` varchar(9) NOT NULL,
`to_id` varchar(9) NOT NULL,
`status` varchar(1) NOT NULL,
PRIMARY KEY (`primary_key`)
) ENGINE=MyISAM AUTO_INCREMENT=123456789876 DEFAULT CHARSET=latin1
请帮忙 :(