package sqldf in R

后端 未结 1 1793
Happy的楠姐
Happy的楠姐 2021-01-28 00:22

Is it possible to add comments inside the string in sqldf?

Something like:

sqldf(\'select ProductID,   
      count(distinct SalePrice) as num_regPz  
         


        
1条回答
  •  一向
    一向 (楼主)
    2021-01-28 01:08

    Comments in SQL use this format:

    /* Comment goes here */

    If you change your code to the following then it should work

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

    0 讨论(0)
提交回复
热议问题