MySQL Update Trigger with Conditions
- by user1760656
I have a PHP app that inserts 'Pass', 'Fail' or 'NA' into fields TEST1, TEST2, TEST3... through TEST15.
I have a field called OVERALL that needs to be automatically updated with 'FAIL' if any of the TEST1-TEST15 fields contains 'Fail'.
I'm pretty sure I need to use a trigger containing the update statement and either CASE or IF, but I haven't been able to nail down the exact syntax.
Can anyone please help a MySQL noob? I'm using MySQL Server version: 5.1.63-0+squeeze1 (Debian).