[英]sqlite3.OperationalError: near “WHERE”: syntax error (Python 2, sqlite3)
[英]sqlite3.OperationalError: near "WHERE": syntax error
我想根據 Country 列中以逗號分隔的國家/地區名稱字符串更新 Country1、Country2... Country 9 列。 我編寫了一個語句來完成這個任務。
cur.execute("\
UPDATE t \
SET Country1 = returnCountryName(Country,0),\
Country2 = returnCountryName(Country,1),\
Country3 = returnCountryName(Country,2),\
Country4 = returnCountryName(Country,3),\
Country5 = returnCountryName(Country,4),\
Country6 = returnCountryName(Country,5),\
Country7 = returnCountryName(Country,6),\
Country8 = returnCountryName(Country,7),\
Country9 = returnCountryName(Country,8),\
Country10 = returnCountryName(Country,9),\
WHERE Country IS NOT NULL\
;")
但是,我收到錯誤
sqlite3.OperationalError: near "WHERE": syntax error
Press any key to continue . . .
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.