MySQL查询语句处理结果-枚举字段

阅读更多
[size=medium]
语法:CASE [COLUMN_] WHEN [situation] THEN .... END AS [NEW_NAME]
SELECT o.WMIO_CODE, 
CASE o.WMIO_TYPE 
WHEN 0 THEN '退货入库' 
WHEN 1 THEN '补货入库' 
WHEN 2 THEN '调拨入库' END AS WMIO_TYPE,
o.WMIO_CUSTOMER_NAME,
o.WMIO_RECEIPT_NUM, 
o.WMIO_REJECT_NUM,
o.WMIO_ANALYSISOR,
o.WMIO_ANALYSIS_TIME 
FROM wm_into_order_10000 o WHERE o.WMIO_CODE = 'I10000025160923002' 
[/size]

你可能感兴趣的:(mysql)