Skip to content
Advertisement

sqlite3.OperationalError: ambiguous column name: views

Help! I try to update the select statement but it seems to not work here So, let me introduced my table Artists and Songs

Note:I already inserted these table yet

and, this is where I update SELECT statement and cause me an error

This is the error

So I decided to change from views to Songs.views

and, it still gave me the error after running

sqlite3.OperationalError: near ".": syntax error

Which one should I edit

Advertisement

Answer

If your version of SQLite is 3.33.0+ then you can use SQlite’s UPDATE-FROM extension to UPDATE statement, with this syntax:

For previous versions of SQLite you can do it with a subquery:

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