【发布时间】:2020-10-30 10:38:25
【问题描述】:
我在 python 中遇到过几次此类问题。而我只想创建一个sql更新查询。
我的脚本如下所示
update1 = '''UPDATE User_Answer_Knowledge SET'''
+ "integration =" + str(21) + ", scope =" + str(12) + ", schedule =" + str(13) + ", cost =" + str(14)
+ ", quality =" + str(15) + ", resource =" + str(16) + ", communication =" + str(17) + "WHERE User_Key = 1"
那么到底是什么问题呢?我也尝试了以下代码,但出现了同样的问题
update1 = '''UPDATE User_Answer_Knowledge SET'''
+ "integration =" + 21 + ", scope =" + 12 + ", schedule =" + 13 + ", cost =" + 14
+ ", quality =" + 15 + ", resource =" + 16 + ", communication =" + 17 + "WHERE User_Key = 1"
update1 = '''UPDATE User_Answer_Knowledge SET'''
+ "integration =" + "21" + ", scope =" + "12" + ", schedule =" + "13" + ", cost =" + "14"
+ ", quality =" + "15" + ", resource =" + "16" + ", communication =" + "17" + "WHERE User_Key = 1"
update1 = '''UPDATE User_Answer_Knowledge SET'''
+ "integration =" + '21' + ", scope =" + '12' + ", schedule =" + '13' + ", cost =" + '14' \+ ", quality =" + '15' + ", resource =" + '16' + ", communication =" + '17' + "WHERE User_Key = 1"
【问题讨论】: