- You could create a trigger and insert values you need into another table.
- I’m not sure, but – for MYISAM tables you could lock
employee
table, select and insert values into another table, and then update and unlockemployee
table.
EDIT:
I have tried one scenario with InnoDb table, seems it works –
START TRANSACTION;
SELECT * FROM table WHERE id = 1 FOR UPDATE; -- lock rows
-- Or call this select to insert and lock rows
-- INSERT INTO table_output SELECT * FROM table WHERE id = 1 FOR UPDATE;
-- Make modifications
UPDATE table SET column1 = '111' WHERE id = 1;
COMMIT;