is it possible in MySQL to update a certain table only if all of the rows of another table match a certain condition? Let me give you an example with a database having two tables:
TableA: id INT, completed BOOLEAN
TableB: total INT, progress INT, tableA_id INT
Can I update TableA setting 'completed=1' if all of the entries of TableB have total==progress? I was thinking about using CASE:
UPDATE TableA SET completed = CASE WHEN (SELECT..) THEN 1 ELSE 0 END WHERE id = x
Of course I don't know how to proceed... Thank you in advance for any help!