Skip to content

RMariaDB returns a query without microseconds

2 messages · Baki UNAL, Ralf Goertz

#
Hi

I can query a table from a mysql database with?RMariaDB. One of the table's column indicates "trade_time" and contains values such as "09:55:02.113000". When I query this table I can not get fractional seconds. I get a value such as "09:55:02". Also I get a variable class such as?"hms" and "difftime" for this column. Not character or POSIX* format. I tried both "datetime" and "varchar(25)" as column type of?"trade_time" in mysql. How can I solve this problem?

Best regards
Baki ?nal
#
Am Mon, 26 Jul 2021 16:07:24 +0000 (UTC)
schrieb Baki UNAL via R-help <r-help at r-project.org>:
Did you tell mariadb to include microsecond? I you just do
+----------+
| d        |
+----------+
| 09:55:02 |
+----------+
1 row in set (0.000 sec)

the fractional part is gone. But if you instead say
you get
+----------------------------+
| d                          |
+----------------------------+
| 2020-07-23 09:55:02.113000 |
+----------------------------+
1 row in set (0.001 sec)

And I also see this in R:
d
1 2020-07-23 09:55:02.113000