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
into machine_report from machine_records join retailers on machine_records.retailer_id=retailers.retailer_id
报错 column "case" specified more than once
------解决方案--------------------
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 试试