我想根据国家/地区列中逗号分隔的国家/地区字符串更新一系列列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\
;")
Howerver,我收到了错误
sqlite3.OperationalError: near "WHERE": syntax error
Press any key to continue . . .