MySQL Forums
Forum List  »  Knowledge Base

Update a subset of a table based on the content of a temp table.
Posted by: Donald Campbell
Date: February 18, 2009 09:16AM

I have to update a few records in a table that have been processed. I have the sub-set in a tempprary table. The complication is that the "index" consists of two fields. Not all combinations of the two fields should be updated, only those in the temp table.

In Unify I am used to being able to update comparing the tuple (pair of fields)
e.g.
update enr_invdetail set eid_status = "D" where (eid_enr_no, eid_sem_no) IN (select (tp1_enr_no, tp1_sem_no) from tp1_file) ;

MySQL does not like this saying that you can only have a single field.

Any ideas how I can perform the update?



Edited 1 time(s). Last edit at 02/19/2009 05:38PM by Donald Campbell.

Options: ReplyQuote


Subject
Views
Written By
Posted
Update a subset of a table based on the content of a temp table.
2999
February 18, 2009 09:16AM


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.