我有 4 张桌子。
我想更新我正在使用连接的所有表。
仅当所有表都有值时,查询才有效。如果任何一个表没有记录,那么它不会更新其他表
我的查询是
update post_message_users
LEFT JOIN post_messages
ON post_message_users.messageid = post_messages.messageid
LEFT JOIN comments
ON post_message_users.messageid = comments.comment_on
LEFT JOIN likes
ON post_message_users.messageid =likes.element_id
SET post_message_users.status='deleted',
post_message_users.deleted_time=NOW(),
post_messages.status = 'deleted' ,
post_messages.delete_time = now(),
comments.status ='deleted',
likes.status='deleted',
likes.delete_time=now()
WHERE
comments.element_type ='Message'
AND
likes.element_type ='Message'
and post_message_users.messageid = 33
and post_message_users.received_by= 3
请查看我应该进行哪些更改才能正常工作。