title: Oracle: How to check if value exists in a collection type column?
body: <p>Let say I've two tables,  </p>
  
  <p>Table A </p>
  
  <pre><code>PK       SIZE  
  89733     5 
  83644     3  
  87351     8
  84423     11
  </code></pre>
  
  <p>Table B</p>
  
  <pre><code> ID      Table_A_PK  
    1     89733,83644,86455   
    2     87351,89542  
    3     84132
    4     84566,84646
  </code></pre>
  
  <p>Note: <strong>Column Table_A_PK</strong> is of collection type, that's why it has many values.</p>
  
  <p>I want to select value of <strong>size</strong> column of <strong>Table A</strong> if column <strong>PK</strong> value exits in <strong>Table B's</strong> column <strong>Table_A_PK</strong></p>
  
  <p>For this I tried this but it's not working and throwing an error </p>
  
  <pre><code>Select {a.SIZE} 
  from {A as a} where {a.PK}  
  in ({{ SELECT {b.Table_A_PK} FROM {B as b}
  </code></pre>
  
  <p><strong>Actual Result:</strong> ORA-01722: invalid number</p>
  
  <p><strong>Expected Result</strong></p>
  
  <pre><code>        SIZE  
           5  
           3  
           8
  </code></pre>