Error 1242(21000) after creating following trigger and performing delete operation
The easiest way to do this, is(for example undo_no 1)
UPDATE undostack SET
id=(SELECT id FROM (SELECT * FROM undostack) u WHERE undo_no=2),
descp=(SELECT descp FROM (SELECT * FROM undostack) u WHERE undo_no=2),
cat=(SELECT cat FROM (SELECT * FROM undostack) u WHERE undo_no=2),
dat=(SELECT dat FROM (SELECT * FROM undostack) u WHERE undo_no=2),
amt=(SELECT amt FROM (SELECT * FROM undostack) u WHERE undo_no=2)
WHERE undo_no=1;

By using (SELECT * FROM undostack) u Mysql generates a table which it uses to select your data.
usully i would say make this better in your pplication code, but five rows is very samll