I have a table called tbl_test:
test_id, int, (Primary Key)
test_A, int
test_B, int
test_C, int
test_updated, int
Basically, I want the value of test_updated to be 0 if test_A, test_B and test_C are all 0. And the value of test_updated to be 1 if any of test_A, test_B or test_C are set to 1. I want the trigger to run on when a row is inserted, or if the row is updated.
What code do I need in order to write this trigger? I'm really struggling here.
Thanks.
test_id, int, (Primary Key)
test_A, int
test_B, int
test_C, int
test_updated, int
Basically, I want the value of test_updated to be 0 if test_A, test_B and test_C are all 0. And the value of test_updated to be 1 if any of test_A, test_B or test_C are set to 1. I want the trigger to run on when a row is inserted, or if the row is updated.
What code do I need in order to write this trigger? I'm really struggling here.
Thanks.