I have a bunch of rows with a certain date that entered the mysql table as zeros. I would love to know a query that will loop through updating one date's values for every row (matching eg fieldname1 and fieldname2) with the previous date's values. I can do it manually or build a php script, but ideally a single mysql update statement would be handy!


dateset fieldname1 fieldname2 value
2013-01-20 a b 0
2013-01-20 a c 0
2013-01-19 a b 1.2345
2013-01-19 a c 5.4321