I have two tables in a mysql database. Memebers and ClassNumbers. Both tables have a paid year field and both have a code field. I want to update the paid year in the Members table with the values from the code numbers table Where code in members is the same as code in ClassNumbers.
I know this is probably nowhere near right but it might explain it a bit better.
UPDATE Members SET paidYear (THE VALUE OF PAID YEAR IN ClassNumbers) where cl_code == code
Members
id,
Paid year,
cl_code,
ClassNumbers
id,
paidyear,
code,
I came across this code when searching other answers I’m thinking it’s something similar
UPDATE business b, people p
SET b.email = p.email
WHERE b.business_id = p.business_id
AND p.sort_order = '1'
AND b.email = ''
1 Answer