SQLDF error - syntax error
I'm running the following command:
sqldf("SELECT * FROM dat WHERE Form LIKE '%compare%' AND Create.Date LIKE '%7/01/11%' AND Post.Status = 'Success'")
but end up getting the following error.
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: near "Create": syntax error)
Can anyone tell me what's up.
> str(dat)
'data.frame': 23 obs. of 12 variables:
$ ID : int 4873 4874 4890 4893 4895 4902 4904 4905 4906 4921 ...
$ Name : Facto开发者_开发技巧r w/ 18 levels "Casey Ryan","Elizabeth Cullen",..: 13 9 15 15 16 15 15 15 16 12 ...
$ Create.Date : Factor w/ 23 levels "03:23.0","14:43.0",..: 3 15 20 13 23 6 12 14 21 4 ...
$ In.Click.ID : int 32787 32788 13480 21050 21041 32824 27807 27806 15350 32911 ...
$ Traffic.Source: Factor w/ 3 levels "FACEBOOK","GOOGLE",..: 3 3 1 3 2 3 3 3 2 3 ...
$ Refer.Domain : Factor w/ 7 levels "","autoinsurancestep",..: 3 2 7 1 2 4 4 2 5 4 ...
$ Form : Factor w/ 3 levels "","autoinsurancestep",..: 2 1 1 1 3 3 3 3 1 3 ...
$ Keyword : Factor w/ 3 levels "","{keyword}",..: 1 1 2 1 3 1 1 1 2 1 ...
$ Ping.Status : Factor w/ 2 levels "","Success": 1 2 1 1 1 2 1 1 1 2 ...
$ Post.Status : Factor w/ 2 levels "","Success": 1 2 1 1 1 2 1 1 1 2 ...
$ Buyer : Factor w/ 8 levels "","ALL_WEB_LEADS",..: 1 6 1 1 1 7 1 1 1 8 ...
$ Amount : int 0 217 0 0 0 3000 0 0 0 1200 ...
In SQL, a dot separates database name from table name. So don't use dots in names for this.
精彩评论