sql - Mysql auto-initialization of timestamp column when adding it to an existent table -



sql - Mysql auto-initialization of timestamp column when adding it to an existent table -

i want add together column table maintain track of when each record lastly updated. have info in table.

the sql query running this:

alter table `my_table` add together column `last_modified` timestamp not null default current_timestamp on update current_timestamp`;

when adding columns of other types existent records default value specify column. in case existent records getting assigned value of: 0000-00-00 00:00:00 why happening if explicitly said wanted default current timestamp?

mysql sql timestamp

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -