Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Concatenate in sql server

$
0
0

Hello,

i have a table which contain two field customer and phonenumber and following record.

Now i want a query for customer-wise  phone number with Concatenating . similiar like attached image.

i am using sql server 2012. what would best query to get this result.

for create table and insert record . use following.

Create Table Information (Customer varchar(255),Phone varchar(256))
Go
Insert into Information values ('ABC','145454541')
Insert into Information values ('ABC','245454542')
Insert into Information values ('ABC','345454543')
Insert into Information values ('ABC','445454544')
Insert into Information values ('ABC','545454545')
Insert into Information values ('DEF','135454541')
Insert into Information values ('DEF','235454542')
Insert into Information values ('DEF','335154543')
Insert into Information values ('DEF','435414544')
Insert into Information values ('DEF','535454545')
Insert into Information values ('GHI','125454541')
Insert into Information values ('GHI','225454542')
Insert into Information values ('GHI','325454543')
Insert into Information values ('GHI','425454544')
Insert into Information values ('GHI','525454545')
GO





Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>