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
proj
My name is busy
Get max score and the fields in the max score row in MySQL 5.7
test
count time interval
lab01
TEST
SMI_SQL
chandu
my sql