title: string_agg function with Condition
body: <p>My query</p>
  
  <pre><code>Select ID,string_agg(doc_id,',') from table group by ID;
  </code></pre>
  
  <p>This gives me </p>
  
  <pre><code>ID       DOC_ID
  123      01,02,03
  456      01
  789      02
  100      01,03
  </code></pre>
  
  <p>Now I don't want data with doc_id as 01 and 02. But if 01 and 02 comes along with other doc_id, then I want that in my out</p>
  
  <p>Now when I am running</p>
  
  <pre><code>Select ID,string_agg(doc_id,',') from table group by ID,doc_id having doc_id not in (02,03) ;
  </code></pre>
  
  <p>Its giving me nothing, whereas I am expecting</p>
  
  <pre><code>ID       DOC_ID
  123      01,02,03
  100      01,03
  </code></pre>
  
  <p>so how to give condition with string agg?</p>