zoukankan      html  css  js  c++  java
  • 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('待派单','待指派','待整改','已整改','已通过','被退回','已作废','非正常关闭')                           |
    +-------------------------------------------------------------------------------------------------------------+
    
    
  • 相关阅读:
    690. 员工的重要性
    91. 解码方法
    153. 寻找旋转排序数组中的最小值
    81. 搜索旋转排序数组 II
    33. 搜索旋转排序数组
    80. 删除有序数组中的重复项 II
    5708. 统计一个数组中好对子的数目
    高精度除法
    易闻app
    2021.4.13
  • 原文地址:https://www.cnblogs.com/chenzechao/p/14072338.html
Copyright © 2011-2022 走看看