【发布时间】:2014-10-15 20:04:20
【问题描述】:
我需要运行多个查询以将数据从 SQL Server 获取到 R 多个时期。我想在 sqlQuery 函数的查询中使用句点作为变量。
我的查询如下:
fld_fec_car<-sqlQuery(dbNGC, "select fld_fec_car
from neptuno.data_mart.[dbo].[tbl_periodo_asig]
where fld_cod_emp='tg'
and fld_periodo ='072014'")
我也想拥有这样的东西
per='072014'
fld_fec_car<-sqlQuery(dbNGC, "select fld_fec_car
from neptuno.data_mart.[dbo].[tbl_periodo_asig]
where fld_cod_emp='tg'
and fld_periodo =&per")
是否可以在 sqlQuery 函数中包含变量值?谢谢。
【问题讨论】: