如何获取MySQL中SET字段的可能值?
要获取set字段的可能值,可以使用以下语法-
desc yourTableName yourSetColumnName;
让我们首先创建一个表-
mysql> create table DemoTable ( Game set('Chess','Pig Dice','29 Card') );
以下是查询以获取设置字段的可用值-
mysql> desc DemoTable Game;
这将产生以下输出-
+-------+-----------------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------------------------------+------+-----+---------+-------+ | Game | set('Chess','Pig Dice','29 Card') | YES | | NULL | | +-------+-----------------------------------+------+-----+---------+-------+ 1 row in set (0.02 sec)