Eric Fail
2012-Mar-28 02:57 UTC
[R] Is it possible to de-select with sqlQuery from the RODBC library?
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
Bart Joosen
2012-Mar-28 09:24 UTC
[R] Is it possible to de-select with sqlQuery from the RODBC library?
What you can do: "SELECT top 1 * FROM your_table;" Use this selection to find all your column names in R then paste everything together without the names you don't want and then run your query. Bart -- View this message in context: http://r.789695.n4.nabble.com/Is-it-possible-to-de-select-with-sqlQuery-from-the-RODBC-library-tp4511189p4511800.html Sent from the R help mailing list archive at Nabble.com.