By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 2 Duplicates: 0 Warnings: 0
| ProgramID | WorkoutID |
|---|---|
| 1 | 100,12,4,55,120,212,45 |
| 2 | 4,15,558,58,55,444,44 |
| TRIM(BOTH ',' FROM REPLACE(CONCAT(',', WorkoutID, ','),',12,',',')) |
|---|
| 100,4,55,120,212,45 |
| 4,15,558,58,55,444,44 |
| TRIM(BOTH ',' FROM REPLACE(CONCAT(',', WorkoutID, ','),',4,',',')) |
|---|
| 100,12,55,120,212,45 |
| 15,558,58,55,444,44 |