I want to make the Total column receive the total sum between the other columns, but i keeping getting the error 1193. I'm new to mySql so i dont know where i should start looking to solve the error.
DELIMITER $$
CREATE TRIGGER Total
BEFORE INSERT ON `despesas` FOR EACH ROW
BEGIN
SET Total = Abertura_Processo+Telefone+Correspondencia+Cartorio+Conservatorio+Servico_Financas+Taxas_Emolumentos+Honorarios;
END;
$$
DELIMITER ;
I've read a bit and for what i've understood I need to create a variable, but i dont know how. The total column has its values manually inserted i want it to be automatically