3

I am trying to use RSQLite to read in tables from my database. All the tables have column names with ".".

For example: my test table has 2 columns: index, first.name

How do I write a query to filter test table with first name column:

My code is:

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

and it gave me an error:

Error: no such column: first.name
southwind
  • 636
  • 4
  • 15

1 Answers1

1

The below should work: Adding []

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

See the below thread: How to write a column name with dot (".") in the SELECT clause?

RK1
  • 2,384
  • 1
  • 19
  • 36