Reputation: 743
Suppose i have a table with the following data:
ClientID ClientName
3 saurabh Malhotra
4 patel Mon
6 Sajith raju
7 Vipin parmar
8 Monoj trivedi
We need to concatenate the ClientName column like the following:
saurabh Malhotra, patelMon, Sajith raju, Vipin parmar, Monoj trivedi
Upvotes: 0
Views: 1071
Reputation: 375
Try This :)
SELECT GROUP_CONCAT(ClientName) FROM Your_table_name
MySQL : Multiple row as comma separated single row
Upvotes: 1
Reputation: 4844
Try this query
select
group_concat(ClientName separator ',') as ClientName
from (select 1 as tempcol,
ClientName
from tablename)tbl
group by tempcol
Upvotes: 1