Update query not effecting all rows in database

Posted by Webnet on Stack Overflow See other posts from Stack Overflow or by Webnet
Published on 2010-05-28T18:25:31Z Indexed on 2010/05/28 18:32 UTC
Read the original article Hit count: 78

Filed under:

I have the following query....

UPDATE vehicle_catalog SET parent_id = 0 WHERE parent_id = SUBSTR(id, 0, 5)

I need to set all parent_ids to 0 where the first 5 characters of id is the same as the parent_id. This is effecting 0 rows when I'm looking at the data and it should be effecting over 10,000.

Any ideas on why this wouldn't be effecting all rows?

© Stack Overflow or respective owner

Related posts about mysql