Joining Update query

Discussion in 'MySQL' started by johnberman, Aug 27, 2017.

  1. #1
    Hi
    I have a number of queries like this

    UPDATE duration_events b
    JOIN meteor_events p
    ON p.event_id = b.event_id
    SET b.image = p.image;

    and

    UPDATE duration_matched b
    JOIN meteor_events p
    ON p.event_id = b.event_id

    SET b.image = p.image;

    Rather than have 2 separate queries can I have these in one query - i did try but had syntax issues.

    Thanks
     
    johnberman, Aug 27, 2017 IP