The following two queries achieve what I want to do with my tables:
Update person_role_memberships, events
set person_role_id = 2
where person_role_id = 32 and event_name = events.name and events.date_2 = curdate() - 1
;
-
update person_role_memberships set person_role_id = 2
where person_role_id = 32 and event_name in
(select name from events where date_2 = curdate() -1
);
I want to know which is the better way of doing that in terms of optimality, safety (corner cases or side-effects) or best practices?