Using RMysql dbGetQuery in R, how can I force a string data type in a result set?

RMysql dbGetQuery converts BigInt to numeric types. This changes some of the meanings. How to read BigInt fields as strings instead of numeric?

+3
source share
1 answer

One way would be to point out things on the SQL side:

select cast(foo as char), bar from someTable;

You may need a more detailed description of the syntax for MySQL castings .

[By the way, there is no [rstats] tag here. ]

+5
source

Source: https://habr.com/ru/post/1754507/


All Articles