Mysql更新列挙enumタイプ

938 ワード

表の定義は次のとおりです.
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