多个if查询及case when 语句

concat( if(t2.`flow_flag`=1 and t1.`field_source`= '06','支付宝账号1',''),
if(t2.`flow_flag`=0 and t1.`field_source`= '06','支付宝账号2',''),
if(t2.`flow_flag`=1 and t1.`field_source`= '07','微信账号1',''),
if(t2.`flow_flag`=0 and t1.`field_source`= '07','微信账号2','')) as '账号',


case `field_source`
when 1 then '支付宝'
when 2 then '微信'
end as '支付来源',

posted on 2022-07-25 11:41  oktokeep  阅读(71)  评论(1)    收藏  举报