假设我有一张包含以下数据的表:
ClientID ClientName
3 saurabh Malhotra
4 patel Mon
6 Sajith raju
7 Vipin parmar
8 Monoj trivedi
我们需要连接ClientName列,如下所示:
saurabh Malhotra,patelMon,Sajith raju,Vipin parmar,Monoj trivedi
答案 0 :(得分:1)
尝试此查询
select
group_concat(ClientName separator ',') as ClientName
from (select 1 as tempcol,
ClientName
from tablename)tbl
group by tempcol
答案 1 :(得分:1)
试试这个:)
SELECT GROUP_CONCAT(ClientName) FROM Your_table_name