Using MySQL, I'm trying to make a timestamp column from a date column and a time column. If the date or time column contains a NULL value, MySQL automatically sets the corresponding value in the TIMESTAMP
column to the CURRENT_TIMESTAMP
.
Is there a way to make it default to a NULL
, instead of the CURRENT_TIMESTAMP
?
Something like:
ALTER TABLE customers ADD s_timestamp TIMESTAMP;
UPDATE customers
SET s_timestamp = timestamp(s_date,s_time) DEFAULT NULL;
NULL DEFAULT NULL
and it worked! – Teishateixeira