Ver originalINSERT INTO tabla (resultado) SELECT (@total:=@total+a+b+c) totalFROM links JOIN (SELECT @total:=0) t1;