例如有表table,table 中有兩個字段:name 、makedate
1.oracle:
插入系統時間應為sysdate:
insert into table (name,makedate) values('測試',sysdate);
2.Db2:
插入系統時間應為current timestamp並且makedate數據類型為timestamp
insert into table (name,makedate) values('測試',current timestamp);
3.SqlServer:
插入系統時間應為GETDATE()
insert into table (name,makedate) values('測試',GETDATE());
4.MySQL:
插入系統時間應:
now():以'yyyy-mm-dd hh:mm:ss'返回當前的日期時間,可以直接存到datetime字段中。
curdate():’yyyy-mm-dd’的格式返回今天的日期,可以直接存到date字段中。
insert into table (name,makedate) values('測試',now());