I'm a bit confused about the proper way to update one table, based on the values of corresponding rows in another table.
Here is the query I have:
UPDATE features, images SET features.deleted = 1 WHERE features.objectType = 'image' AND images.id = features.objectId AND images.uploaded = 0;
I want to set the
features.deletedcolumn value for all rows in the
featurestable to be
1, only if the corresponding
images.uploadedvalue for that associated image is
I want to go over all the images that been created in my app, and if the image wasn't successfully uploaded, I want to delete the corresponding
I believe this works, but have been having a hard time finding specific examples using my approach (most suggest using
My concern is that the
UPDATE query is too general: I just want to make sure that it will only update
feature records that have their associated
image record with an
uploaded value of
Thanks for any guidance/confirmation!