RSQLite无法读取带有“。”的列名。

时间:2019-08-12 07:23:21

标签: r sqlite

我正在尝试使用RSQLite从数据库中读取表。所有表的列名都带有“。”。

例如:我的测试表有2列:索引,first.name

如何编写查询以过滤具有名字列的测试表:

我的代码是:

dbGetQuery(con,"SELECT * FROM test WHERE 'first.name' = 'Joe'")

它给了我一个错误:

Error: no such column: first.name

1 个答案:

答案 0 :(得分:0)

以下内容应该起作用:添加[]

dbGetQuery(con,"SELECT * FROM test WHERE [first.name] = 'Joe'")

请参见以下线程: How to write a column name with dot (".") in the SELECT clause?