有什么方法可以获取表中SET字段的可用值?

谢谢你。

最佳答案

您可以使用DESCRIBE myTableName mySetColumnSHOW COLUMNS FROM myTableName LIKE mySetColumn检索SET字段的可能值:

  mysql> DESCRIBE myTableName mySetColumn;
  +-------+-------------------------------------------+------+-----+---------+-------+
  | Field | Type                                      | Null | Key | Default | Extra |
  +-------+-------------------------------------------+------+-----+---------+-------+
  | myset | set('Travel','Sports','Dancing','Dining') | YES  |     | NULL    |       |
  +-------+-------------------------------------------+------+-----+---------+-------+

信息性文章here,手册here

关于mysql - 如何获取SET字段的可用值?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2622481/

10-09 00:44