how to solve this trigger in MySQL?

1
create trigger tr_kmanterior before insert on t_consumos for each row
set new.kmanterior_c = (preview.kmatual_c);

OR

create trigger tr_kmanterior before insert on t_consumos for each row
set new.kmanterior_c = (old.kmatual_c);

I need to put in kmanterior_c , the value of kmatual_c , of the previous line.

I have tried with these two examples and others, the wrong calculation or wrong.

    
asked by anonymous 26.08.2016 / 03:58

0 answers