title: Postgres Group by json array column
body: <p>I'm having a hard time understanding Postgres json array type. How to do a group by using json array column. For example:</p>
  
  <pre><code>select product, avg(sales)
  from Order 
  group by product
  </code></pre>
  
  <blockquote>
    <p>"Error: could not identify an equality operator for type json"</p>
  </blockquote>
  
  <pre><code>--Order--
  id | sales | product                 
  1  | 36    | ["874746", "474657"] 
  2  | 120   | ["874748"] 
  3  | 15    | ["874736", "474654"] 
  </code></pre>