mysql> select name, GROUP_CONCAT( age SEPARATOR ‘#’) from student group by name; +——————+—————————————+ | name | GROUP_CONCAT( age SEPARATOR ‘#’) | +——————+—————————————+ | 315134Y | 75 | | C34A89EC57276F7C | 33 | | oyy | 23#24#25#26 | | Z54ZX4Z | 39 | | zyy | 22 | +——————+———————————-+