Hello. Assuming the following table/data:
Is there a way I can update the 'list' column with a comma separated list of the numbers between the low and high numbers?
I'm hoping to end up with
Low High List
1 10 1,2,3,4,5,6,7,8,9,10
15 25 15,16,17,18,19,20,21,22,23,24,25
22 28 22,23,24,25,26,27,28
Thanks!
Brian
Code:
create table #temp (low int, high int, list varchar(100))
go
insert into #temp (low, high) values (1, 10)
insert into #temp (low, high) values (15, 25)
insert into #temp (low, high) values (22, 28)
Is there a way I can update the 'list' column with a comma separated list of the numbers between the low and high numbers?
I'm hoping to end up with
Low High List
1 10 1,2,3,4,5,6,7,8,9,10
15 25 15,16,17,18,19,20,21,22,23,24,25
22 28 22,23,24,25,26,27,28
Thanks!
Brian