【发布时间】:2015-05-08 17:45:44
【问题描述】:
我不知道如何正确转义这些引号。如何添加需要引号来表示“澳大利亚”和“巴西”附近的字符串的 SQL?以下在 R Studio 中作为 R markdown 运行。
错误信息如下。
---
title: "Mobile Product Reporting"
author: "super john"
date: "Thursday, May 07, 2015"
output: html_document
---
<h1>Regional Summary</h1>
```{r echo = FALSE}
library(RODBC)
conn <- odbcConnect("db_connection")
regional <- sqlQuery(conn, 'select
month_year, region, round(sum(revenue), 2) as revenue
from
db.data_table
where lower(region) <> 'australia'
and lower(region) <> 'brazil'
and region is not null
group by month_year , region
order by date')
knitr::kable(regional)
```
ERROR MESSAGE
Quitting from lines 39-51 (Preview-3ac1bc22a.Rmd)
Error in parse(text = x, srcfile = src) : <text>:7:25: unexpected symbol
6: rfi_analytics.jh_monthly_mobile2
7: where lower(region) <> 'australia
^
Calls: <Anonymous> ... evaluate -> parse_all -> parse_all.character -> parse
Execution halted
【问题讨论】:
-
"string string string 'australia' string string string"怎么样