update tab1 left join (select * FROM tab1 , (select max(`id`) as f4, min(`id`) as f5 FROM tab1) as t2) as t3 using (id) set tab1.f1 = tab1.f1 + t3.f4
хм. [скл] прокрутку не показывает
update tab1 left join (select * FROM tab1 , (select max(`id`) as f4, min(`id`) as f5 FROM tab1) as t2) as t3 using (id) set tab1.f1 = tab1.f1 + t3.f4