Hi,
I want to ask how would I concatenate multiple columns of a row into a single row or string?
Ex:
FirstName LastName Country
John Cruz Philippines
Result:
John,Cruz,Philippines
I just need it now..
help help..
thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Apr 27, 2012, 4:35 AM
It is simple and you can concatenate the result as single column.
SELECT FirstName+','+LastName+','+Country AS [Result] FROM table_name
Try this and let me know.
anand sengarPosted Apr 27, 2012, 8:53 AM
SELECT isnull(FirstName,'')+' '+isnull(LastName,'')+' '+isnull(MiddleName,'') AS FullName FROM table_name
MuthuMari MPosted Apr 27, 2012, 4:14 AM
SELECT (FirstName + ' , ' + LastName ' , ' + country) "Employee First & Last Name" FROM Employees
ORDER BY FirstName ASC
Pls refer this for more samples,
http://www.mysqltutorial.org/mysql-join-subqueries.aspx
Thanks.