做个笔记,SQL CASE选择语应用

SELECT 
(CASE WHEN [CapacityStatus]=0 THEN '达标'
       WHEN [CapacityStatus]=1 THEN '超产能' 
       WHEN [CapacityStatus]=2 THEN '不达标' 
  ELSE 'Eorr' END)AS CapacityStatus ,PKDKey
  FROM [IMS_QC].[dbo].[ProductionKanBanDetail]


你可能感兴趣的:(做个笔记,SQL CASE选择语应用)