I want to create a trigger to insert into another table the ID row if a certain conditions are verified.
SWAB_TEST
id_swab
id_user
result
NO_INFECTED
id_user
For example i want to insert into NO_INFECTED table the ID of the user who swab test is negative
SWAB_TEST
id_swab : Test1
id_user : 1
result : negative
NO_INFECTED
id_user: 1
I created this trigger but I don't know how to insert the condition
CREATE OR REPLACE TRIGGER test_trigg
AFTER INSERT ON swab_test
FOR EACH ROW
BEGIN
INSERT INTO no_infected (id_user)
VALUES(:new.id_user);
END;