title: Postgres GROUP BY Array Column
body: <p>I use postgres &amp; have a table like this :</p>
  
  <pre class="lang-sql prettyprint-override"><code>id   | arr
  -------------------
   1   | [A,B,C]
   2   | [C,B,A]
   3   | [A,A,B]
   4   | [B,A,B]
  </code></pre>
  
  
  
  <p>I created a GROUP BY 'arr' query.</p>
  
  <pre><code>SELECT COUNT(*) AS total, "arr" FROM "table" GROUP BY "arr"
  </code></pre>
  
  <p>... and the result :</p>
  
  <pre class="lang-sql prettyprint-override"><code>total | arr
  -------------------
   1    | [A,B,C]
   1    | [C,B,A]
   1    | [A,A,B]
   1    | [B,A,B]
  </code></pre>
  
  
  
  <p>BUT, since [A,B,C] and [C,B,A] have the same elements, so i expected the result should be like this :</p>
  
  <pre class="lang-sql prettyprint-override"><code>total | arr
  -------------------
    2   |   [A,B,C]
    2   |   [A,A,B]
  </code></pre>
  
  
  
  <p>Did i miss something (in query) or else? Please help me..</p>