Python 3.x 如何解决操作错误:near";(";:sqldf python中的语法错误?
我正在熊猫数据框上运行一个简单的查询:Python 3.x 如何解决操作错误:near";(";:sqldf python中的语法错误?,python-3.x,sqldf,lead,Python 3.x,Sqldf,Lead,我正在熊猫数据框上运行一个简单的查询: l="""select LEAD(quarter_num,1) OVER (ORDER BY col1 , col2, col3) AS next from df""" out=ps.sqldf(l, locals()) Error:OperationalError: near "(": syntax error 是否Lead函数在sqldf中不受支持。我想在python中执行sql代码,因此必须限制自己使用sqldf和Lead 有什么帮助吗
l="""select LEAD(quarter_num,1) OVER (ORDER BY col1 , col2, col3) AS next from df"""
out=ps.sqldf(l, locals())
Error:OperationalError: near "(": syntax error
是否Lead
函数在sqldf
中不受支持。我想在python中执行sql代码,因此必须限制自己使用sqldf和Lead
有什么帮助吗