title: How to put filter condition on group_concat columns?
body: <h3>TABLE 1</h3>
  
  <pre><code>+----+--------+
  | id | name   |
  +----+--------+
  |  2 | robin  |
  |  3 | jyothi |
  |  1 | angel  |
  +----+--------+
  </code></pre>
  
  <h3>TABLE 2</h3>
  
  <pre><code>+----+---------+--------+
  | id | hobbies | ref_id |
  +----+---------+--------+
  |  1 | walking |      1 |
  |  2 | chating |      1 |
  |  3 | reading |      2 |
  |  4 | walking |      2 |
  +----+---------+--------+
  </code></pre>
  
  <p>I want name &amp; their hobbies who have hobby as 'walking' or name is 'robin'</p>
  
  <pre><code>+----+-----------------+
  | name | hobbies       | 
  +----+-----------------+
  |  1 | walking,chating |      
  |  3 | reading,surfing |    
  +----+-----------------+
  </code></pre>
  
  <h3>used query:</h3>
  
  <pre><code>select name, group_concat(hobbies) as all_hobbies
  from test1,test2
  where test1.id = test2.ref_id 
  and test1.id in (select ref_id
                from test2
                where hobbies = 'walking')
  group by name
  </code></pre>
  
  <p>I don't want to use subquery or save the entire result as virtual table &amp; the search on all_hobbies though where clause. I want to do accomplish the group_concat columns through where clause or some way around as its increasing my SQL_JOIN_SZIE </p>
  
  <p>I cannt use having here as that has to act as or condition for eg: </p>
  
  <p>Either hobbies is 'walking' or name is 'robin'</p>