I have two tables jhead
and jjops
. I am updating jhead
with the following statement:
UPDATE jhead h
SET h.jhpcmp = 1
WHERE h.jhpcmp = '0' AND h.jhpqty <= h.jhqtys
But now I want to update jjops
based upon what I updated in jhead
. The statement would be like:
UPDATE jjops j
SET j.jascmp = 1, japcmp = 1
WHERE (This is where I am stuck)
What links the two tables is the following: h.jhjob = j.jajob
Is there some way to update both of the tables together? Should I first update table jjops
using a join and then update table jhead
and if so what Join should I use?