MySQL时间类型Timestamp和Datetime 的深入理解(3)

mysql -D dbtest -e "drop tables test01" mysql -D dbtest <test01.sql select * from test01; 5.0.67版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-12 14:15:19 | 2018-01-12 14:15:19 | +---------------------+---------------------+ 5.5.20版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-12 14:15:27 | 2018-01-12 14:15:27 | +---------------------+---------------------+ 5.6.22版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-07 20:13:22 | 2018-01-07 20:13:22 | +---------------------+---------------------+ 5.7.18版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-07 20:13:20 | 2018-01-07 20:13:20 | +---------------------+---------------------+

(4)ON UPDATE CURRENT_TIMESTAMP属性影响

如果包含ON UPDATE CURRENT_TIMESTAMP属性,则如果对表记录更新,此记录对应的timestamp类型记录也会更新

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/45069013b744e1e5e7b92f0827152e76.html