sqldf('Select a.guest_id,case when b.guest_id is not null then 'old' else 'new' end as tagging from JDUniqueGuestid as a
left join UniqueGuestidallsource b
ON a.guest_id = b.guest_id', drv="SQLite")
运行上面的代码后出现以下提到的错误,请帮助我并解决问题
错误:“ ON a.guest_id”中的意外符号
最佳答案
您在整个查询中都有单引号,但在查询中也有单引号。它没有按照您想要的方式进行解析。
根据更大的上下文,可能会执行以下操作:
"Select a.guest_id, case ... 'old' else 'new' ... ON a.guest_id = b.guest_id"
否则,您可能需要使用以下内容对单引号进行转义:
'Select a.guest_id, case ... \'old\' else \'new\' ... ON a.guest_id = b.guest_id'
这取决于查询字符串出现的上下文,以及它如何解析带引号的字符串。
关于sql - 错误:“ON a.guest_id”中出现意外符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56791806/