本文介绍了如何获取SET字段的可用值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以获取表中SET字段的可用值?
Is there any way to get available values for SET field in table?
谢谢.
推荐答案
您可以使用DESCRIBE myTableName mySetColumn
或SHOW COLUMNS FROM myTableName LIKE mySetColumn
来检索SET字段的可能值:
You can retrieve the possible values for a SET field using DESCRIBE myTableName mySetColumn
or SHOW COLUMNS FROM myTableName LIKE mySetColumn
:
mysql> DESCRIBE myTableName mySetColumn;
+-------+-------------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------------------------------------+------+-----+---------+-------+
| myset | set('Travel','Sports','Dancing','Dining') | YES | | NULL | |
+-------+-------------------------------------------+------+-----+---------+-------+
这篇关于如何获取SET字段的可用值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!