Updating colums two Tables at a time

admin

Administrator
Staff member
i need to update a column in two tables with the same value. They are joined tables (one to many): FILES and Comments.

this works:

UPDATE FILES
SET Is_Deleted='1'
WHERE File_Id='1'

Why not this?

UPDATE FILES, COMMENTS
SET FILES.Is_Deleted = '1',
COMMENTS.Is_Deleted = '1'
WHERE LEFT JOIN COMMENTS ON FILES.File_Id = COMMENTS.File_Id Where FILES.File_Id = '31'
 
Back
Top