select orderid AS 订单编号, case type when 11 then '退货' when 12 then '换货' else '非退换货' end as 类型,finalAmount AS 金额 from table
注意:else end 不能少,否则语法错误,与sqlserver不同。
select orderid AS 订单编号, case type when 11 then '退货' when 12 then '换货' else '非退换货' end as 类型,finalAmount AS 金额 from table
注意:else end 不能少,否则语法错误,与sqlserver不同。