I have a reports table with value as shown below
id reportIdList
1 123, 124, 125
2 123, 124, 125
3 123, 124, 125, 127
4 123, 124, 125, 127
I need some help with sql to add additional value as in
id reportIdList
1 123, 124, 125, *126*
2 123, 124, 125, *126*
3 123, 124, 125, *126*, 127
4 123, 124, 125, *126*, 127
Currently I have a way to update
update reports set reportIdList = reportIdList || ',126';
But this would update the table as shown below:
id reportIdList
1 123, 124, 125, *126*
2 123, 124, 125, *126*
3 123, 124, 125, 127, *126*
4 123, 124, 125, 127, *126*
Any help is appreciated, thanks
insert into ...
– a_horse_with_no_name Dec 2 '19 at 21:13