Created
November 19, 2018 07:41
-
-
Save joeke80215/1050cfba285e92245ca4f49ee327ea01 to your computer and use it in GitHub Desktop.
mysql add timestamp when update row
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TRIGGER `testTrigger` BEFORE UPDATE ON `testTable` | |
FOR EACH ROW SET NEW.<timestamp col>=TIMESTAMPDIFF(SECOND,OLD.SENDTIME,NOW()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment