pythonのsql liteの別のテーブルの値でテーブルの列を更新する方法。selectクエリを使用したPython SQL Liteの更新
たとえば、私はこの
をやろうとしています= 1idのTABLE1ブランド= B1を更新したい
TABLE1
id name value brand
1 n1 v1 -
2 n2 v2 -
table2の
id brand
1 b1
UPDATE table1 r join table2 p on r.id= p.id set r.brand=p.brand
が、Pythonは任意のソリューションは、私はあなたがSET
句の左側から.
を削除する必要があると考えてい
'UPDATE table1 SET table1.brand =(SELECT table2.brand FROM table2 WHERE table2.id = table1.id)'? http://stackoverflow.com/questions/3845718/sql-how-to-update-table-values-from-another-table-with-the-ame-user-name – Cyclonecode
それは動作しません。 sqlite3.OperationalError:near "。":構文エラー – Saravana