数据库时间类型使用timestamp在更新数据的时候都会自动更新时间吗?

0
已邀请:
2

- 取是能力,舍是境界 2016-08-17 回答

这就是他存在的意义。

ba674e1d82625bce808f3a56471465bd.png

 
1

蓝心 2016-08-17 回答

你是指一张表中,一个字段,类型定为timestamp,当你更新数据的时候,会不会自动更新?
如果你是的这个字段有默认值,默认的是当前系统时间戳, 那么在insert插入数据的时候,不插入这个字段,会自动插入当前系统时间,但是update更新的时候,如果你不更新这个字段,它不会自动更新成当前系统时间的,还是原来插入时候的时间。
0

老头子 - 专注是唯一的捷径 2016-08-19 回答

oracle中
timestamp作为一个数据类型的情况下,如果表中不设定默认值并不会自动维护

The TIMESTAMP data type is an extension of the DATE data type. It stores the year, month, and day of the DATE data type, plus hour, minute, and second values. This data type is useful for storing precise time values and for collecting and evaluating date information across geographic regions. Specify the TIMESTAMP data type as follows:TIMESTAMP [(fractional_seconds_precision)]where fractional_seconds_precision optionally specifies the number of digits Oracle stores in the fractional part of the SECOND datetime field. When you create a column of this data type, the value can be a number in the range 0 to 9. The default is 6.



QQ图片20160819103828.png

 
0

newlove 2016-08-19 回答

内在是二进制数字,表面是可以任意类型,例如可以把timestamp设置为自增长ID,只不过名字和内容有点区别,哈哈

要回复问题请先登录注册