end 后加 as 别名。

解决方案 »

  1.   

    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 检查下查出的数据 多对一了
      

  2.   

    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 试试