title: Count the number of overlapping elements in Postgres array
body: <p>I have an array of integer as a column.</p>
  
  <p>Is there a way to query the number of overlapping integers?</p>
  
  <p>For example for the following 3 records:</p>
  
  <pre><code>COLUMN1
  {1,3,7}
  {3,4,5}
  {1,2}
  </code></pre>
  
  <p>How can I get the number of overlapping elements with ARRAY[3,4,8] ?</p>
  
  <p>The result for my example should be:</p>
  
  <pre><code>1 (element 3)
  2 (element 3 and 4)
  0 (none)
  </code></pre>
  
  <p>I've found </p>
  
  <pre><code>SELECT COLUMN1 &amp;&amp; ARRAY[44,45,46] FROM table1
  </code></pre>
  
  <p>But that returns a true or false.</p>