Skip to content
Advertisement

SQLite3 syntax error on tested sql script

I’m using python 3.6.4 and sqlite3 2.6.0 to query the nearest consecutive dates in my table in a sqlite 3.27.2 file.

I’ve tried to get the actual sql string with vscode debugger and test it with DB Browser for SQLite. It works as I expect.

Here’s the code:

An exception occurs:

Advertisement

Answer

Window functions support was first added to SQLite with release version 3.25.0 (2018-09-15), according to official documentation.

When using Python, you are using Python SQLite3 client library (which is distributed with Python) instead of your system SQLite3 installation. For Python 2.7, the version is 3.11.0, which is below your required version.

You may try using a newer SQLite3 client library, as suggested by these answers.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement