title: Postgres is value in column
body: <p>I have two tables A and B. B includes a column <code>binder</code> which contains integers. Now I want to search those rows of table A which are in placed in A.binder. The following statement does what I want:</p>
  
  <pre><code>SELECT * FROM A WHERE A.binder=ANY(SELECT binder FROM B)
  </code></pre>
  
  <p>But I expected something like</p>
  
  <pre><code>SELECT * FROM A WHERE A.binder=ANY(B.binder)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>SELECT * FROM A WHERE A.binder IN array_agg(B.binder)
  </code></pre>
  
  <p>would work. Consider B.binder could contain duplicates. Therefor I cant simplify the statement by using inner join.</p>