Insert same data into two MySQL columns

0

Hello! I have a table with the name tabx and two columns y and z, when I will insert the values in the column and I need a trigger to copy this value to the z-column. Have I tried some solutions but unsuccessfully can someone help me?

    
asked by anonymous 06.01.2017 / 23:15

1 answer

2

+ or- this

CREATE TRIGGER ins_table BEFORE INSERT ON table   FOR EACH ROW  BEGIN      SET NEW.z = new.y;  END; //

    
06.01.2017 / 23:38