title: How to Check the rows exist in mysql database with Group_Concat()
body: <p>I have a table named group_members, where I am inserting user_id(FK from users) with group_id(FK from groups). Now, When I am creating a group I am trying to check whether group is already created with selected users or not.</p>
  
  <p>Now I can get true/false based on group_id from group_members by matching users with group_concat() by group_id. My query is like this</p>
  
  <pre><code>select if(group_concat(cgm.`user_id`) = '35237512,640664658',cgm.group_id,false) as  _return from group_members cgm
  INNER JOIN groups cg ON
  cgm.`group_id` = cg.`group_id` 
      where   cg.`created_by` = 388567678 group by cgm.group_id
  </code></pre>
  
  <p>Now I am trying to get only the row which match with the users I am sending.</p>
  
  <p>So I can avoid calling two stored procedures or having loops.</p>
  
  <p>Thanks in advance. </p>