在python中运行Sqlite给我[HY000]错误

时间:2019-06-27 18:22:41

标签: python sqlite

打招呼

我有这个sqlite查询,该查询在sqlite中按预期运行

CREATE TABLE 'Time_node1'
AS
SELECT no,
LAG(p.Time) OVER(ORDER BY p.no) PreviousValue,
    p.Time,
    LEAD(p.Time) OVER(ORDER BY p.no) NextValue
FROM table1 p
WHERE SourceName = 'node1'

我需要在python中多次运行此查询,但这给了我一个错误

cur.execute("CREATE TABLE 'Time_node1' AS SELECT no,LAG(p.Time) OVER(ORDER BY p.no) PreviousValue, p.Time,LEAD(p.Time) OVER(ORDER BY p.no) NextValue FROM table2 p WHERE SourceName = 'node1'")

错误

Error: ('HY000', '[HY000] near "(": syntax error (1) (1) (SQLExecDirectW)')

任何帮助将不胜感激

0 个答案:

没有答案