Ali Ahmadi
Ali Ahmadi

Reputation: 2417

merge rows data in tsql

I have a table with one column that include this data

Data
'a'
'b'
'c'
'd'
'e'
'f'

How can I get combine Data column data in one varchar with cte?

result : 'abcdef'

Upvotes: 0

Views: 140

Answers (1)

Adriaan Stander
Adriaan Stander

Reputation: 166576

You could quite simply do it using

SELECT '' + [Data] 
FROM Table1
FOR XML PATH ('') 

SQL Fiddle DEMO

Upvotes: 2

Related Questions