【问题标题】:package sqldf in R在 R 中打包 sqldf
【发布时间】:2017-06-18 18:54:11
【问题描述】:

是否可以在sqldf中的字符串内添加cmets?

类似:

sqldf('select ProductID,   
      count(distinct SalePrice) as num_regPz  
      from MYDF  
      where SalesFlag=0   # coded value to identify regular prizes  
      group by ProductID')

此处“# 用于标识常规奖品的编码值”表示注释,而不是 select 语句的一部分。

【问题讨论】:

    标签: r sqldf


    【解决方案1】:

    SQL 中的注释使用这种格式:

    /* 评论放在这里 */

    如果您将代码更改为以下代码,那么它应该可以工作

    sqldf('select ProductID,   
          count(distinct SalePrice) as num_regPz  
          from MYDF  
          where SalesFlag=0   /* coded value to identify regular prizes  */
          group by ProductID')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-07
      • 2013-08-16
      • 2012-01-03
      • 2015-11-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多