select case sales_type when 'S' then 'Supply agreement' when 'C' then 'Outright purchase' end, case adidas_division when 'Footwear' then 'Footwear' when 'AandG' then 'A&G' when 'Apparel' then 'Apparel' else '-' end 检查下查出的数据 多对一了
SELECT (CASE WHEN sales_type = 'S' THEN 'Supply agreement' WHEN sales_type = 'C' THEN 'Outright purchase' END) AS a, (CASE WHEN adidas_division='Footwear' THEN 'Footwear' WHEN adidas_division='AandG' THEN 'A&G' WHEN adidas_division='Apparel' THEN 'Apparel' ELSE '-' END) b 试试
when 'S' then 'Supply agreement'
when 'C' then 'Outright purchase'
end,
case adidas_division
when 'Footwear' then 'Footwear'
when 'AandG' then 'A&G'
when 'Apparel' then 'Apparel'
else '-'
end 检查下查出的数据 多对一了
WHEN sales_type = 'C' THEN 'Outright purchase'
END) AS a,
(CASE WHEN adidas_division='Footwear' THEN 'Footwear'
WHEN adidas_division='AandG' THEN 'A&G'
WHEN adidas_division='Apparel' THEN 'Apparel'
ELSE '-'
END) b 试试