python字符串组成MySql 命令时,插入数据报错
python向mysql数据库插入数据时经常会碰到一些特殊字符,如单引号,双引号。
原代码
sql2 = "select ds, country, per_hundred from covid_vaccination_doses_per where country = '{}'".format(i[0])
报错
pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that
转载
2021-04-11 10:46:13 ·
509 阅读 ·
1 评论