create function getChildList(rootId varchar(100)) returns varchar(2000)
BEGIN   
DECLARE str varchar(2000);  
DECLARE cid varchar(100);   
SET str = '$';   
SET cid = rootId;   
WHILE cid is not null DO   
    SET str = concat(str, ',', cid);   
    SELECT group_concat(serialno) INTO cid FROM flow_task where FIND_IN_SET(relativeserialno, cid) > 0;   
END WHILE;   
RETURN str;   
END;

