I am trying to search and update a record that starts with a partial number or falls with a range.
I made a query that works where values ββstart with a specific number. I can't figure out how to do this with a range.
For example, I want to update the following values ββin products_ean with ""
255 201-230 ---> starts with 201,202,203 ...230 236 980-990 ---> starts with 980.981,982 ...990
I wrote the following query, which works, but not sure if it is espcialy efficient when it needs to process more than 100 thousand records. It does not work with a range.
UPDATE products SET products_ean ="" where products_ean like "200%" OR products_ean like "020%" OR products_ean like "023%" OR products_ean like "027%" OR products_ean like "042%" OR products_ean like "221%" OR products_ean like "209%" OR products_ean like "041%" OR products_ean like "049%" OR products_ean like "026%" OR products_ean like "025%" OR products_ean like "299%";
source share