id first_name surname player_number
1 Alexis Sanchez 7
2 Petr Cech 33
3 Hector Bellerin 24
4 Olivier Giroud 12
5 Theo Walcott 14
6 Santi Cazorla 19
如果我启动此命令,
SELECT CONCAT(first_name,' ',surname,' #',player_number) as 'i' from soccer_team order by player_number
它给了我
i
Alexis Sanchez #7
Olivier Giroud #12
Theo Walcott #14
Santi Cazorla #19
Hector Bellerin #24
Petr Cech #33
这是正确的
然而,当我跑
时SELECT GROUP_CONCAT(i,' ') as 'players'
FROM (SELECT CONCAT(first_name,' ',surname,' #',player_number) as 'i'
from soccer_team
order by player_number
) as a;
它给了我
players
Alexis Sanchez #7 ;Petr Cech #33 ;Hector Bellerin #24 ;Olivier Giroud #12 ;Theo Walcott #14 ;Santi Cazorla #19
虽然它应该是
players
Alexis Sanchez #7; Olivier Giroud #12; Theo Walcott #14; Santi Cazorla #19; Hector Bellerin #24; Petr Cech #33
**
如何解决我所知道的问题,我想知道为什么会发生这种情况
**
更新
我知道如何解决它,我感兴趣的是因为它在这方面起作用 方式