[R] Is it possible to de-select with sqlQuery from the RODBC library?

Eric Fail eric.fail at gmx.us
Wed Mar 28 04:57:03 CEST 2012


Dear R-list,

I'm queering a M$ Access database with the sqlQuery function from the RODBC library. As I cannot make a working example with a database here is an illustrative example,

library(RODBC)
mdbConnect<-odbcConnectAccess("S:/data/ ... /databse.mdb")
data <- sqlQuery(mdbConnect, "select id, DOB, V1, V2, ..., V1009, V1011, V1013 from someTable")

I want everything in the table (someTable), except 'V1010' and 'V1012,' but I can't figure out how to make a negative or reverse SQL select statement. I have a lot of someTables and I have two or three variables in each table that I do not want R to fetch,

Is there a way to define a reverse select in SQL? One would imagine it would look something like this,

data <- sqlQuery(mdbConnect, "deselect V1010, V1o12 from someTable")

Thanks,
Eric



More information about the R-help mailing list