VictorZurkowski
VictorZurkowski

Reputation: 202

package sqldf in R

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

Something like:

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

Here "# coded value to identify regular prizes" is meant as a comment, and not as a part of the select statement.

Upvotes: 0

Views: 265

Answers (1)

RobR
RobR

Reputation: 76

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')

Upvotes: 4

Related Questions