时间函数 now() current_timestamp() 和 sysdate()
CURRENT_TIMESTAMP
andCURRENT_TIMESTAMP()
are synonyms forNOW()
.
也就是说 CURRENT_TIMESTAMP
和 CURRENT_TIMESTAMP()
都是 NOW()
这个函数的同义词,所以作用相同,
而sysdate()函数的解释是
SYSDATE()
returns the time at which it executes. This differs from the behavior forNOW()
, which returns a constant time that indicates the time at which the statement began to execute. (Within a stored function or trigger,NOW()
returns the time at which the function or triggering statement began to execute.)
简单来说,now()
(current_timestamp()
)函数获得的是语句开始执行时的时间,而sysdate()
函数是这个函数执行时候的时间。
所以 Insert into tablea (a,b,c,inserttime) select a,b,c,sysdate(3) from tableb
本文来自博客园,作者:o0o0o9,转载请注明原文链接:https://www.cnblogs.com/o0o0o9/p/16446648.html