Concatenation of integers with commas in SQL Server? -
i find execute following query:
select * table id in (1,2,3,4) is there function can concatenate resultset returns integers commas?
for example
concatenate(select id table) return 1,2,3,4
this trick... think more efficient in application layer there times (reporting) when end resorting these types of tricks.
declare @liststr varchar(max) select @liststr = coalesce(@liststr+',' ,'') + cast(id varchar(10)) table select @liststr i learned trick pinal dave see: create comma delimited list using select clause table column
Comments
Post a Comment