title: To use SELECT query in WHERE clause
body: <p>I want to list rows from a table which relates to a where clause which need to compare list of records from two tables</p>
  
  <pre><code>SELECT DISTINCT (CONA.DOCUMENTID), CONA.CONTENTID 
  FROM TABLEA AS CONA 
  INNER JOIN TABLEB AS CTAGA ON CTAGA.CONTENTID = CONA.CONTENTID
  WHERE CONA.DOCUMENTID LIKE 'PM%' 
  AND (
    SELECT TAGID 
    FROM  TABLEB 
    WHERE CTAGA.CONTENTID = CONA.CONTENTID
  ) IN (SELECT TAGID FROM TABLEC)
  </code></pre>
  
  <p>In the above <code>SELECT TAGID FROM  TABLEB WHERE CTAGA.CONTENTID = CONA.CONTENTID</code> will have</p>
  
  <p>abc,def,ghi,jkl,mno</p>
  
  <p>and</p>
  
  <p><code>SELECT TAGID FROM TABLEC</code> will have abc,def,ghi,jkl,mno,pqr,stu</p>
  
  <p>Is it possible to check the all the records in list A is there in list B</p>
  
  <p>Using the above I additionally the multiple values in the table</p>