MySQL Forums
Forum List  »  Newbie

UPDATE TABLE WITH DATA SELECT IN THE TABLE
Posted by: serenella angelilli
Date: March 30, 2022 08:19AM

Hi
i create a temporary table in this step:

CREATE TEMPORARY TABLE IF NOT EXISTS tmp_update AS (
SELECT i.id, i.is_active FROM cg_hs_subscriber_ibans i
JOIN cg_hs_subscribers s on s.id = i.subscriber_id
JOIN cg_hs_groups g on g.id = s.group_id
LEFT JOIN cg_hs_hss h on h.id = g.hs_id
WHERE h.id = 2 and i.is_active = 0
);

and after i create this step:


UPDATE cg_hs_subscriber_ibans SET is_active = 1
WHERE subscriber_id IN (SELECT id FROM tmp_update);


the update don't work! please help me!

Options: ReplyQuote


Subject
Written By
Posted
UPDATE TABLE WITH DATA SELECT IN THE TABLE
March 30, 2022 08:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.