当插入数据时,如果某一列没有指定值,则会使用该列的默认值。例如:
SQL> create table test_date (id int,time date default '2017-11-01 00:00:00');
Table created.
SQL> insert into test_date values(1,'');
1 row created.
SQL> select * from test_date;
ID TIME
---------- -------------------
1
SQL> insert into test_date values(1,null);
1 row created.
SQL> select * from test_date;
ID TIME
---------- -------------------
1
1
SQL> insert into test_date values(2,default);
1 row created.
SQL> select * from test_date;
ID TIME
---------- -------------------
1
1
2 2017-11-01 00:00:00