打招呼
我有这个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)')
任何帮助将不胜感激