title: GROUP_CONCAT WHERE clause
body: <p>To show how many users have accepted request for some item ( i.e pending = 0 ) , prefixed with name of user who sends request.</p>
  
  <pre><code>items :
  item_id  item_name
  1         I1
  2         I2
  
  profile :
  user_id name
  1        A
  2        B
  3        C
  4        D
  
  user_items :
  user_id  shared_by_user_id  pending    item_id
  1         2                  1            1
  3         2                  0            1
  4         2                  0            1
  1         2                  1            2
  </code></pre>
  
  <h2>expected Output</h2>
  
  <pre><code>item_name    users     shared_by_user_id  
  I1           B,C,D                 2          
  I2           B                     2          
  </code></pre>
  
  <p>I have written following query and its output is as below - </p>
  
  <pre><code>select item_name, concat(t4.name, ',',group_concat(t3.name)) as users, t1.shared_by_user_id
  from user_items t1 
  left join item t2 on t2.item_id = t1.item_id
  left join profile t3 on t3.user_id = t1.user_id
  left join profile t4 on t4.user_id = t1.shared_by_user_id 
  where t1.shared_by_user_id = 2 
  group by t2.item_id;
  </code></pre>
  
  <h2>Actual Output</h2>
  
  <pre><code>item_name    users     shared_by_user_id  
  I1           B,A,C,D              2          
  I2           B,A                  2 
  </code></pre>
  
  <p>Clearly, remaining problem is to add a CONDITION for filtering pending = 1 records during GROUP_CONCAT ,but not able to find how..</p>