group by like string
SELECT DISTINCT SUBSTRING(employee_id FROM 5 FOR 5)
FROM employee;



  some of record contains 3 to 4 _ symbol and position is different


SELECT DISTINCT CONCAT('_',
                       SUBSTRING_INDEX(SUBSTRING_INDEX(employee_id, '_', 2), '_', -1),
                       '_')
FROM employee;