title: Math calculating with two JSONB keys in Postgres?
body: <p>I have JSONB column with data like:</p>
  
  <pre><code>{"plays": {"win": 90, "draw": 8, "lose": 2}}
  </code></pre>
  
  <p>How I can calculate sum with <code>win</code> and <code>draw</code> keys?</p>
  
  <p>Something like:</p>
  
  <pre><code>SELECT
      data::json#&gt;&gt;'{plays,draw}' + data::json#&gt;&gt;'{plays,win}' as "total_plays",
  FROM
      plays_data;
  </code></pre>