Subject Match two fields in same table using a trigger
Author thedevguy
Is there a way to sync two columns in the same table using a trigger. For example I have field1 and field2. On an insert or an update I would like field2 = field1 if they are different.

I tried something like the following but it doesn't work.

TRIGGER:
if (new.field1 <> old.field2) then
new.field2 = new.field1;

Any help would be greatly appreciated.