title: ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
body: <p>Logic</p>
  
  <p>The logic is if an order is cancelled then return 0 otherwise return the owed value - the paid value</p>
  
  <p>Small query</p>
  
  <pre><code>CASE WHEN d.cancelled = 'TRUE' 
       THEN '0' 
       ELSE (to_char(b.owed)) - (to_char(d.paid)) 
       END AS balance,
  </code></pre>
  
  <p>Getting the error</p>
  
  <blockquote>
    <p>ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
    00932. 00000 -  "inconsistent datatypes: expected %s got %s"
    *Cause:<br>
    *Action:
    Error at Line: 25 Column: 58</p>
  </blockquote>