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.
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')
来源:https://stackoverflow.com/questions/41989734/package-sqldf-in-r