mysql enum 枚举

MySQL [DB_NAME]> desc TABLE_NAME;
| status                        | enum('待派单','待指派','待整改','已整改','已通过','被退回','已作废','非正常关闭')                           | YES  |     | NULL              |                             |

select status+0 as status_num,status from TABLE_NAME limit 10;
+------------+-----------------+
| status_num | status          |
+------------+-----------------+
|          1 | 待派单          |
|          7 | 已作废          |
|          5 | 已通过          |
|          4 | 已整改          |
|          2 | 待指派          |
|          3 | 待整改          |
|          8 | 非正常关闭      |
+------------+-----------------+
7 rows in set (15.33 sec)

select COLUMN_TYPE from COLUMNS where TABLE_SCHEMA = 'DB_NAME' and table_name = 'TABLE_NAME' and COLUMN_NAME='status' limit 100;
+-------------------------------------------------------------------------------------------------------------+
| COLUMN_TYPE                                                                                                 |
+-------------------------------------------------------------------------------------------------------------+
| enum('待派单','待指派','待整改','已整改','已通过','被退回','已作废','非正常关闭')                           |
+-------------------------------------------------------------------------------------------------------------+

原文地址:https://www.cnblogs.com/chenzechao/p/14072338.html