title: Postgresql Select and display one column based on another column
body: <h3>WALLET TABLE</h3>
  
  <p>ID   IS_SPEND   HOWMUCH</p>
  
  <ol>
  <li>true.      500</li>
  <li>false.     1000</li>
  <li>true.      5</li>
  </ol>
  
  <p>I want to calculate how much money I have after several transactions.</p>
  
  <p>spend as spend money and not spend as earn money</p>
  
  <p>I tried </p>
  
  <pre class="lang-sql prettyprint-override"><code>select is_spend, sum(howmuch) from table group by is_spend
  </code></pre>
  
  <p>But it cannot reach my goal.</p>
  
  <p>I don't know how can I get the result I want, </p>
  
  <p>just output <code>495</code> is perfect.</p>