select `a`.`tdorderid`,group_concat('类型:',(case `a`.`td_type` when 'no_goods' then '无货退款' when 'low_quantity' then '质量退款'
when 'no_reason' then '非质量退款' else '无' end),'/退货员:',(case when`a`.`td_user` is null then '无'
when `a`.`td_user` is not null then `a`.`td_user` end) separator ',') AS `goods1` from `gr_reject_goods` `a` group by `a`.`tdorderid`
在group_concat函数里面使用case when 语法与一般情况无异。
case when 在判断是否为null的时候要注意,字段 is null ,字段is not null