delete from yourtable t
where
instr(','||t.col||',', '123') > 0
You can replace '123' with a parameter if you like.
But a better way would be not to store comma separated values, and create a detail table instead. If you need to look for a specific value within a comma separated list, you cannot make use of indices, amongst other limitations.
[edit]
Misunderstood the question. You meant this:
update YourTable t
set
t.col = substr(substr(replace(','||t.col||',', ',123,', ','), 2), -2)
where
instr(','||t.col||',', '123') > 0
- Add ',' before and after to match items at the beginning or end of the value.
- Replace using the value ',123,' (within comma's) to prevent accidentally matching 1234 too.
- Use substr twice to remove the first and last character (the added commas)
- Use instr in the where to prevent updating records that don't need to be updated (better performance).