title: CASE WHEN ... THEN
body: <p>I'm trying to edit a code someone wrote some months ago, but I can't understand some parts, for example:</p>
  
  <pre><code>CASE
     WHEN #PROMPT('SEL_TYPE')# = '%' then 1
     WHEN #PROMPT('SEL_TYPE')# = 'ALL' then 1
     WHEN e.evt_job = #PROMPT('SEL_TYPE')# then 1
     ELSE 0
  END = 1
  </code></pre>
  
  <p>Wherever I read about how <code>CASE .. WHEN</code> works, it's like:</p>
  
  <pre><code>CASE A 
      WHEN 'ok' THEN C = 'ok'
      WHEN 'bad' THEN C = 'bad'
  </code></pre>
  
  <p>But im my example it's just <code>THEN 1</code> or <code>ELSE 0</code>.</p>
  
  <p>Whats the meaning of that 1 or 0? It's something I'm missing on the code, or that 1 or 0 means something?</p>
  
  <p>Thanks all, and sorry for my English :)</p>