Previous table column value in update query

A post was split to a new topic: Use temporary table