Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Last active April 7, 2021 11:35
Show Gist options
  • Save uncoded-ro/737e445204b4effd37458209a9c54d45 to your computer and use it in GitHub Desktop.
Save uncoded-ro/737e445204b4effd37458209a9c54d45 to your computer and use it in GitHub Desktop.
SET autocommit=0;
LOCK TABLES sakila.actor WRITE;
INSERT INTO sakila.actor (first_name, last_name)
VALUES ("BRUCE", "JOHNSON");
UPDATE sakila.actor
SET last_name = "JOHNSON"
WHERE actor_id = 1;
COMMIT;
UNLOCK TABLES;
SET autocommit=1;
SELECT *
FROM sakila.actor
ORDER BY last_update DESC
LIMIT 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment