Mysql 3.23.45 sobre apache, tabla MyISAM
Tengo una columna enum y la quiero cambiar a set sin perder los datos, y no se si es posible solamente con alter table??
Gracias
Zarate
| |||
Re: Cambio de tipo de columna <pre>mysql> create table tabla (columna enum('1','2','3')); Query OK, 0 rows affected (0.00 sec) mysql> desc tabla; +---------+-------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------------+------+-----+---------+-------+ | columna | enum('1','2','3') | YES | | NULL | | +---------+-------------------+------+-----+---------+-------+ 1 row in set (0.00 sec) mysql> insert into tabla (columna) values ('1'); Query OK, 1 row affected (0.00 sec) mysql> select * from tabla; +---------+ | columna | +---------+ | 1 | +---------+ 1 row in set (0.00 sec) mysql> alter table tabla modify columna set('1','2','3'); Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> desc tabla; +---------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+------------------+------+-----+---------+-------+ | columna | set('1','2','3') | YES | | NULL | | +---------+------------------+------+-----+---------+-------+ 1 row in set (0.00 sec) mysql> select * from tabla; +---------+ | columna | +---------+ | 1 | +---------+ 1 row in set (0.00 sec) mysql> </pre> |