0

A table has a column with same value over multiple rows. I want to change this value to another value.

The rows in the column named regex that have a specific value e.g. ^(\+\d{1,2}\s)?(?\d{3})?[\s.-]\d{3}[\s.-]\d{4}$ need to be changed to NULL.

What I tried

The following statement works but would be really time consuming because I have to write each row's ID.

UPDATE Country
SET regex = NULL
WHERE ID IN ('1','2','3')

Is there a better (faster) way to change the values without using IN predicate with a predefined list?

hc_dev
  • 8,389
  • 1
  • 26
  • 38
Loopinfility
  • 15
  • 1
  • 7
  • It can be `UPDATE Country SET regex= NULL WHERE regex = 'some old value'` – Kadet Jul 08 '22 at 08:06
  • Try `WHERE regex = '^(\+\d{1,2}\s)?(?\d{3})?[\s.-]\d{3}[\s.-]\d{4}$'` to select rows that have this value. – hc_dev Jul 08 '22 at 08:24

0 Answers0