oracleANDmysql 2019-04-06
代码如下:
mysql> create table db_set( -> set1 set('x','y','z') not null, -> enum1 enum('one','two','three') not null); Query OK, 0 rows affected (0.06 sec) mysql> desc db_set; +-------+---------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------------+------+-----+---------+-------+ | set1 | set('x','y','z') | NO | | NULL | | | enum1 | enum('one','two','three') | NO | | NULL | | +-------+---------------------------+------+-----+---------+-------+ mysql> insert into db_set values(1,3),(1,4),(4,1); Query OK, 3 rows affected, 1 warning (0.00 sec) Records: 3 Duplicates: 0 Warnings: 1 mysql> select * from db_set ; +------+-------+ | set1 | enum1 | +------+-------+ | x | three | | x | | | z | one | +------+-------+ 3 rows in set (0.01 sec)