Details
Description
This SQL script:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (date VARCHAR(32), format VARCHAR(30));
INSERT INTO t1 VALUES ('2003-01-02 10:11:12','%Y-%m-%d %H:%i:%S');
SELECT str_to_date(date, format) AS a, coalesce(str_to_date(date, format)) AS b FROM t1;
returns the following results:
+---------------------+----------------------------+ | a | b | +---------------------+----------------------------+ | 2003-01-02 10:11:12 | 2003-01-02 10:11:12.000000 | +---------------------+----------------------------+
Notice, "a" returns 0 fractional digits, while "b" returns 6 fractional digits.
The data type for the both expressions is DATETIME(6).
"a" should return 6 digits, like "b" does.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions