title: If condition with group_concat in mysql
body: <p>I have table which has 2 columns empid &amp; depid. This table does not have any primary key. Below is the data of the table.</p>
  
  <pre><code>+-------+-------+
  | empid | depid |
  +-------+-------+
  |     1 |     1 |
  |     1 |     2 |
  |     1 |     3 |
  |     1 |     4 |
  |     2 |     1 |
  |     2 |     2 |
  |     2 |     3 |
  |     2 |     4 |
  +-------+-------+
  </code></pre>
  
  <p>Now to select all the depids for an employee I wrote below query.</p>
  
  <pre><code>select empid, group_concat(depid separator ':') from emp group by empid;
  </code></pre>
  
  <p>It is giving me expected output.</p>
  
  <pre><code>+-------+-----------------------------------+
  | empid | group_concat(depid separator ':') |
  +-------+-----------------------------------+
  |     1 | 1:2:3:4                           |
  |     2 | 1:2:3:4                           |
  +-------+-----------------------------------+
  </code></pre>
  
  <p>Now I want select only those depids which are greater than 2. How can I use if with group_concat?</p>