|
create or replace table t1 (a timestamp);
|
insert t1 values ('2018-3-25 1:30:00');
|
create or replace table t2 as select a + interval 1 hour from t1;
|
show create table t2;
|
returns
+-------+----------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+----------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`a + interval 1 hour` datetime DEFAULT NULL
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
+-------+----------------------------------------------------------------------------------------------------------+
|
Should be timestamp, not datetime.
This should cover all temporal arithmetic functions, e.g. ADDTIME too.
|