0

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

3
  • possible duplicate of How to use GROUP BY to concatenate strings in MySQL? Commented Jul 23, 2015 at 5:26
  • you are getting completely wrong..please read question again and then compare.. Commented Jul 23, 2015 at 5:28
  • 1
    I'm not completely wrong, take another look Commented Jul 23, 2015 at 5:29

2 Answers 2

1

Try this query

select 
     group_concat(ClientName  separator ',') as ClientName 
from (select 1 as tempcol,
           ClientName 
     from tablename)tbl
group by tempcol
Sign up to request clarification or add additional context in comments.

Comments

1

Try This :)

SELECT GROUP_CONCAT(ClientName) FROM Your_table_name

MySQL : Multiple row as comma separated single row

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.