Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MySQL updates first timestamp column automatically
#MySQL 5.7.12 #please drop objects you've created at the end of the script #or check for their existance before creating #'\\' is a delimiter # start clean slate drop table game; # build tables and insert data CREATE TABLE game (team1 VARCHAR(32), team2 VARCHAR(32), start TIMESTAMP, end TIMESTAMP); INSERT INTO game VALUES ("argentina", "brazil", now(), now()); # see table select * from game; # update just the column team1 update game set team1 = "ram" where team1 = "argentina"; # you will notice that two columns team1 and start are modified (interesting feature of mysql where it updates the first timestamp column select * from game; # clean up drop table game;
run
|
edit
|
history
|
help
1
Test for MySQL "serializable" transaction, part 2
emp
Srinivas
tooo
my sql
Subrahmanyamk
Adding a number
ITM_14210069
Point System Alpha.1
update if the id based on difference in time