[R] Where Query in SQL

MacQueen, Don macqueen1 at llnl.gov
Mon Jun 10 21:35:04 CEST 2013


Do this

cat(sql.select,'\n')

and then decide whether the query is what it should be according to
standard SQL syntax.
(If it is not, then fix it.)

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 6/10/13 11:47 AM, "Sneha Bishnoi" <sneha.bishnoi at gmail.com> wrote:

>Hey all
>
>I am trying to use where in clause in sql query in R
>here is my code:
>
>sql.select<-paste("select PERSON_NAME from UNITS where UNIT_ID in
>('",cathree,"')",sep="")
>
>where cathree is 1 variable with 16 observations as follows
>
>UNIT_ID
>1 205
>2 209
>3 213
>4 217
>5 228
>6 232
>7 236
>8 240
>9 245
>10 249
>11 253
>12 257
>13 268
>14 272
>15 276
>16 280
>
>but when i run this code, 0 rows are selected eventhough there exist 3
>rows
>which satisfy the above query
>
>
>Thanks
>Sneha
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list