q1<- dbGetQuery(conn,
"SELECT UNIQUELETTERCODE_y ,
COMPLETION.MODE,
COMPLETED.BY,
Current.Status,
Completed.by.which.group
FROM Daily_Returns
WHERE AgentName IS NULL AND
CASEID IS NULL AND
Completed.by.which.group = OUTBOUND AND
Current.Status = Completed AND
(COMPLETED.BY = CALL OR
COMPLETED.BY = CISCO OR
COMPLETED.BY = MOBILE) AND
COMPLETION.MODE =CALL
GROUP BY UNIQUELETTERCODE_y
")
使用上面的代码一直提示这个Error: Error in rsqlite_send_query(conn@ptr, statements) : close ".": 语法错误,知道如何解决这个问题吗?
您的查询中有拼写错误。这是一个固定的查询:
"
SELECT DISTINCT UNIQUELETTERCODE_y,
COMPLETION_MODE,
COMPLETED_BY,
Current_Status,
Completed_by_which_group
FROM Daily_Returns
WHERE AgentName IS NULL AND
CASEID IS NULL AND
Completed_by_which_group = 'OUTBOUND' AND
Current_Status = 'Completed' AND
(COMPLETED_BY = 'CALL' OR
COMPLETED_BY = 'CISCO' OR
COMPLETED_BY = 'MOBILE') AND
COMPLETION_MODE = 'CALL'
"
'
,例如
'OUTBOUND'
、'Completed'
等.
。在 SQL 中,句点 (.) 通常用于限定表名或列名,并且列名不直接支持点表示法。在大多数情况下,列名称不能包含句点。