是否可以在sqldf中的字符串内添加注释?
就像是:
sqldf('select ProductID,
count(distinct SalePrice) as num_regPz
from MYDF
where SalesFlag=0 # coded value to identify regular prizes
group by ProductID')
这里的“#编码值来识别常规奖品”是作为注释,而不是作为选择语句的一部分。
SQL 中的注释使用以下格式:
/* 评论放在这里 */
如果您将代码更改为以下内容,那么它应该可以工作
sqldf('select ProductID,
count(distinct SalePrice) as num_regPz
from MYDF
where SalesFlag=0 /* coded value to identify regular prizes */
group by ProductID')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)