sql server - How to concatenate a column value with single quotes in sql? -
how concatenate column value single quotes , comma in sql?
select tpaa_id dbo.sheet tpaa_id not null
at present query returns, value ..
abc123 abc456
we have around 1000 records.
i expect return
'abc123', 'abc456',
you can use variable concatenation:
declare @result nvarchar(max) select @result = isnull(@result + ', ', '') + '''' + tpaa_id + '''' dbo.sheet tpaa_id not null select @result
Comments
Post a Comment