SQLite Forum

nested case statement not working
Login
see if:

```
select quote(deptno), 
       quote(job), 
       comm,
       case deptno
            when 'A00' then (comm * 1.1)
            when 'D11' then (comm * 1.2)
            when 'C01' then case job
                                 when 'ANALYST' then (comm * 1.3)
                                 when 'MANAGER' then (comm * 1.4)
                                 else null
                            end
                       else comm
       end as newcomm
  from emp
 where comm is not null
   and deptno <> 'E21'
;
```

And see if the results shed light ...