How do you select all columns, plus the result of a CASE statement in oracle 11g?

后端 未结 3 1535
迷失自我
迷失自我 2021-02-01 04:12

I want to select *, and not have to type out all individual columns, but I also want to include a custom column with a case statement. I tried the following:

se         


        
3条回答
  •  [愿得一人]
    2021-02-01 04:23

    Do it like this:

    select e.*,
    case deptno
    when 30 then 'High'
    when 20 then 'Medi'
    when 10 then 'Low'
    else 'Very Low'
    end case
    from emp e order by deptno desc;
    

提交回复
热议问题