-
-
Save zmack/5749432 to your computer and use it in GitHub Desktop.
Sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> create table mars( id int unsigned, bar enum('foo','bar','baz')) | |
mysql> insert into mars values (1,'foo'), (2, 'bar'), (3, 'baz'); | |
mysql> select * from mars; | |
+------+------+ | |
| id | bar | | |
+------+------+ | |
| 1 | foo | | |
| 2 | bar | | |
| 3 | baz | | |
+------+------+ | |
3 rows in set (0.00 sec) | |
mysql> alter table mars change bar bar enum('moo', 'foo', 'bar', 'baz'); | |
mysql> select * from mars; | |
+------+------+ | |
| id | bar | | |
+------+------+ | |
| 1 | foo | | |
| 2 | bar | | |
| 3 | baz | | |
+------+------+ | |
3 rows in set (0.00 sec) | |
mysql> alter table mars change bar bar enum('moo', 'goo', 'bar', 'baz'); | |
Query OK, 3 rows affected, 1 warning (0.36 sec) | |
Records: 3 Duplicates: 0 Warnings: 1 | |
mysql> select * from mars; | |
+------+------+ | |
| id | bar | | |
+------+------+ | |
| 1 | | | |
| 2 | bar | | |
| 3 | baz | | |
+------+------+ | |
3 rows in set (0.00 sec) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment