我想更新一系列列Country1,Country2。。。国家9基于列Country中以逗号分隔的国家名称字符串。我编写了一个语句来完成这项任务。在
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\
;")
但是,我得到了错误
^{pr2}$
您必须从最后一个作业中删除逗号:
另请参见原始问题的my answer
相关问题 更多 >
编程相关推荐