- case的使用
case OperationHistory.OperationName
when 'RetrieveContainers'
then '出库'
when 'RemoveMaterial'
then '出库'
when 'StoreContainers'
then '入库'
when 'PutMaterial'
then '入库'
end as type1
- case的嵌套
case type1
when '出库'
then
case status1
when '1'
then null
when '2'
then '2'
ELSE null
END
when '入库'
then
case status1
when '1'
then '1'
ELSE null
END
END AS statuss