The Kingdom Tech The Kingdom Tech - 3 months ago 7
SQL Question

Change one character in PostgreSQL column string

I have a hundreds of entries in a description column that look like the following:

CAP 0.001UF ±10% 50V X7R 0402

I need to change it to:

CAP 0.001UF +/-10% 50V X7R 040

How can I search through the records and change all instances of


How about using replace() and like?

update t
    set description = replace(description, '±', '+/-')
    where description like '%±%';