表定義如下:
CREATE TABLE `t_seat` (
`id` bigint(20) NOT NULL,
...
`type` enum('seat','passage') DEFAULT NULL COMMENT '座位類型(座位、過道)',
...
PRIMARY KEY (`id`),
KEY `place_id` (`place_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='座位表'
如果要更新type,使用如下語句:
update t_seat a set a.type = 'seat' where a.type = ''
不能這么使用:
update t_seat a set a.type = 'seat' where a.type is null