case when 销售组 like 'SGA%' THEN CASE WHEN 销售组='SGA-BMS' THEN 'SGA-BMS'
WHEN 销售组='SGA-W&NP' THEN 'SGA-W&NP'
ELSE 'SGA-Phone'
END
WHEN 销售组 like 'SGB%' THEN 'SGB'
WHEN 销售组 like 'SGC%' OR 销售组 like 'BUD%' OR 销售组 like 'BUE%' OR 销售组 like 'SGD%' THEN 'SGC'
WHEN 销售组 like '汽车%' THEN '汽车'
WHEN 销售组 like '半导体%' THEN '半导体'
WHEN 销售组 like '乔峰%' THEN '乔峰'
else '其他'
end as ttype
group by 后面为
case when 销售组 like 'SGA%' THEN CASE WHEN 销售组='SGA-BMS' THEN 'SGA-BMS'
WHEN 销售组='SGA-W&NP' THEN 'SGA-W&NP'
ELSE 'SGA-Phone'
END
WHEN 销售组 like 'SGB%' THEN 'SGB'
WHEN 销售组 like 'SGC%' OR 销售组 like 'BUD%' OR 销售组 like 'BUE%' OR 销售组 like 'SGD%' THEN 'SGC'
WHEN 销售组 like '汽车%' THEN '汽车'
WHEN 销售组 like '半导体%' THEN '半导体'
WHEN 销售组 like '乔峰%' THEN '乔峰'
else '其他'
end