代码之家  ›  专栏  ›  技术社区  ›  tommy chheng

在R中使用RMysql的dbGetQuery,如何强制结果集中的字符串数据类型?

  •  3
  • tommy chheng  · 技术社区  · 14 年前

    RMysql的dbGetQuery将BigInt转换为数字类型。这会改变一些值。如何将BigInt字段读取为字符串而不是数字?

    1 回复  |  直到 14 年前
        1
  •  5
  •   Dirk is no longer here    14 年前

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

    你可能得查一下 MySQL casting syntax 详情。

    [顺便说一下,这里没有标签[rstats]。]