I have a string like this:
2011-11-11 11:11:11.111111
and I need to insert it in MySql, into a datetime column. But after I insert it, it b
As documented under Fractional Seconds in Time Values:
A trailing fractional seconds part is permissible for temporal values in contexts such as literal values, and in the arguments to or return values from some temporal functions. Example:
mysql> SELECT MICROSECOND('2010-12-10 14:12:09.019473'); +-------------------------------------------+ | MICROSECOND('2010-12-10 14:12:09.019473') | +-------------------------------------------+ | 19473 | +-------------------------------------------+However, when MySQL stores a value into a column of any temporal data type, it discards any fractional part and does not store it.
Note that this behaviour has changed in v5.6.4.