I am creating a new table, and I would like each row to have a column that is equal to the time that the row is inserted into the table. Is there a way to do this in the create table statement or do I have to do this in my insert statement?
This should work:
CREATE TABLE table1 (
timeStampColumn TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
Something like this when creating the table.
CREATE TABLE t1 (
insert_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With