Reputation: 1
I used update sql to update a table,but i forget "where",one column all data to null. How can I do to let the data recovery to before update operate? Please help me!!
Upvotes: 0
Views: 388
Reputation: 8431
If you define table type as InnoDB, you can use transactions (see the link below). You will need set AUTOCOMMIT=0, and after you can issue COMMIT or ROLLBACK at the end of query or session to submit or cancel a transaction.
ROLLBACK -- will undo the changes that you have made
Upvotes: 3