If condition with group_concat in mysql
Try as below :
SELECT empid, GROUP_CONCAT(IF(depid > 2, depid, NULL) SEPARATOR ':')
FROM emp
GROUP BY empid;
Try as below :
SELECT empid, GROUP_CONCAT(IF(depid > 2, depid, NULL) SEPARATOR ':')
FROM emp
GROUP BY empid;