sql server - how to take some columns from a database in R -


i want database take few columns , use in r.

require(rodbc) ch <- odbcconnect("ims") 

so connected database

i have many tables , want take 1 so:

ress <- sqlfetch(ch, "fact_gpim")  

and last have columns , want take few rows, cause there many rows, think use query:

y<-sqlquery(ch, paste("select ress[[5]] ress","where ress[[5]]=0549604")) 

but wrong , don't know what. text appears

    > y [1] "42000 105 [microsoft][sql server native client 11.0][sql server]unclosed quotation mark after character string '[5] ress ress[[5]=0549604'." [2] "[rodbc] error: not sqlexecdirect 'select ress[[5]] ress ress[[5]]=0549604'" 

what wrong?


Comments

Popular posts from this blog

Java 3D LWJGL collision -

methods - python can't use function in submodule -

c# - ErrorThe type or namespace name 'AxWMPLib' could not be found (are you missing a using directive or an assembly reference?) -