4 ms·
In MySQL (and SQL Server, apparently), it reflects the specific point in time when this row was last updated, and neither database will let you have more than o
by randallsquared 16y ago
In MySQL (and SQL Server, apparently), it reflects the specific point in time when this row was last updated, and neither database will let you have more than one such field in a table. The data type everyone here seems to want is "datetime", which behaves like you want a "timestamp" to behave.
- JoachimSchipper 16y ago> neither [MySQL nor SQL server] ... will let you have more than one [timestamp] field in a table. Wait, what?
- gxti 16y agoThere can be only one because it exists solely to be the "last updated" field. There's no point in having more than one. In MySQL, it simply only updates the first -- so you get a sometimes magic field.
- JoachimSchipper 16y agoI would think it useful to have 'created' and 'updated' fields, for instance. And silently updating only the first...
- randallsquared 16y agoBut you can have this: the "created" field is a datetime field, and the "updated" field would be "timestamp". This is far less problematic, in my opinion, than things like requiring a table with exactly one row to do simple selects, or pretending the empty string and null are the same (both of these behaviors are Oracle, by the way, not postgresql).
- deleted 16y ago[deleted]