I'm a beginner in RStudio, but been looking for the answer for quite a while already.
I'm using RODBC sqlQuery to retrieve data from database with ODBC connection.
However, inside sqlQuery I would like to refer to an existing object (table) in my RStudio project.
Lets say I've loaded data from xlsx file onto RStudio into "table1". I want to join some data to this table using sqlQuery and ODBC from database. How do I go about this? If I just refer to this table as "from table1" inside the SQL query, it says "table or view does not exist".
It feels to me there should be a way to do this. I can't just load the whole table B from database and then join them with R, because the table is huge.