I have used this query on many occasions and never had an issue. I just like to know is this the best option when updating 10,000 plus rows with 1 query?
I am updating and making changes to a postal codes database and some of these can get quite large.
This is what I am using (imagine it being 10,000 plus postal codes)
UPDATE postalcodes
SET user = CASE postal
WHEN 'M4C 1A1' THEN '1'
WHEN 'M4C 1A2' THEN '1'
WHEN 'M4C 1A3' THEN '1'
END
WHERE postal IN ('M4C 1A1','M4C 1A2','M4C 1A3')
In all cases when updating the USER will always be the same.
Am I doing this correctly or is there a more faster, optimized solution? Thanks.