MySQL Forums
Forum List  »  General

Re: Issues setting a default value/expression in a MySQL table
Posted by: Rick James
Date: October 16, 2016 04:36PM

MySQL 5.6.4 and MariaDB 5.3 introduced Microsecond support.

Why did you want that lengthy expression instead of
RIGHT(NOW(3), 3)

mysql> SELECT NOW(3), RIGHT(NOW(3), 3);
+-------------------------+------------------+
| NOW(3)                  | RIGHT(NOW(3), 3) |
+-------------------------+------------------+
| 2016-10-16 15:34:31.266 | 266              |
+-------------------------+------------------+

However you might need

RIGHT(NOW(3), 3) + 0

to make it numeric.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.