pymysql inserts data into MySQL and reports an error for no reason

A strange thing, in the process of using pymysql to insert data into MySQL, the following error is reported (the insertion of some tables does not report an error!)

pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '- the number of paid buyers, the number of fans paid buyers, plus Purchase goods - pay the number of buyers, guide the shop' at line 1")
insert image description here

The insertion form of the data used is as follows:

insert into 生意参谋_无线店铺来源数据(日期,流量来源,来源明细,访客数,访客数环比,下单金额,下单金额变化,下单买家数,下单买家数变化,下单转化率,下单转化率变化,支付金额,支付金额变化,支付买家数,支付买家数变化,支付转化率,支付转化率变化,客单价,客单价变化,UV价值,uv价值变化,关注店铺买家数,关注店铺买家数变化,收藏商品买家数,收藏商品买家数变化,加购人数,加购人数变化,新访客,新访客变化,直接支付买家数,收藏商品-支付买家数,粉丝支付买家数,加购商品-支付买家数,引导店铺页访客数,引导店铺页访客数变化) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)

Wrong guess:
It is estimated that the field is too long and there is an exception in the insertion

You can use the following second method to insert data

# 第一种方式
insert into 表名(字段名1,字段名2,...) values(1,2,...);

# 第二种方式:按照表中所有字段进行插入数据,一定要与字段在表中定义的顺序一致
insert into  表名 values(1,2,...);

Guess you like

Origin blog.csdn.net/The_dream1/article/details/125372256