i hope fine , learning more. need advice on update statement populate 1 column on run table. using mysql 5.6.25-. please find below table , data scripts. create table test (symbol varchar(2), sym_date date, amount int, diff_amt int primary key (symbol,sym_date)) engine=innodb; insert test(symbol,sym_date, amount) values('a','2015-07-01',200); insert test(symbol,sym_date, amount) values('a','2015-07-02',100); insert test(symbol,sym_date, amount) values('a','2015-07-03',500); insert test(symbol,sym_date, amount) values('a','2015-07-04',800); insert test(symbol,sym_date, amount) values('b','2015-07-03',300); insert test(symbol,sym_date, amount) values('b','2015-07-05',500); insert test(symbol,sym_date, amount) values('b','2015-07-06',600); insert test(symbol,sym_date, amount) values('c','2015-07-09',100); insert test(symbol,sym_date, amount) values('c...