当前位置:网站首页>pymysql 向MySQL 插入数据无故报错
pymysql 向MySQL 插入数据无故报错
2022-06-24 07:05:00 【YJ语】
一件怪神奇的事情,在使用pymysql向MySQL插入数据的过程中,报以下错误(一些表的插入没有报错!)
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 ‘-支付买家数,粉丝支付买家数,加购商品-支付买家数,引导店铺’ at line 1”)
使用的数据的插入形式如下:
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)
错误猜测:
估计是字段太长导致插入中存在异常
可以使用以下第二种的方式进行数据的插入
# 第一种方式
insert into 表名(字段名1,字段名2,...) values(值1,值2,...);
# 第二种方式:按照表中所有字段进行插入数据,一定要与字段在表中定义的顺序一致
insert into 表名 values(值1,值2,...);
边栏推荐
- leetcode 1268. Search Suggestions System(搜索推荐系统)
- JUC个人简单笔记
- Shell pass parameters
- 图片工具
- [real estate opening online house selection, WiFi coverage temporary network] 500 people are connected to WiFi at the same time
- AUTO PWN
- ZUCC_编译语言原理与编译_实验04 语言与文法
- Variable declaration and some special variables in shell
- jwt(json web token)
- String转Base64
猜你喜欢
How to improve the customer retention rate in the operation of independent stations? Customer segmentation is very important!
2022 mobile crane driver special operation certificate examination question bank and online simulation examination
Maya re deployment
ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
New technology practice, encapsulating the permission application library step by step with the activity results API
【无标题】
成为IEEE学生会员
[micro services ~nacos] Nacos service providers and service consumers
5分钟,客服聊天处理技巧,炉火纯青
ZUCC_编译语言原理与编译_实验04 语言与文法
随机推荐
提高INSERT速度
[acnoi2022] not a structure, more like a structure
dataX使用指南
[real estate opening online house selection, WiFi coverage temporary network] 500 people are connected to WiFi at the same time
中国芯片独角兽公司
Xtrabackup for data backup
ZUCC_编译语言原理与编译_大作业
2021-03-04 comp9021 class 6 notes
"Adobe international certification" Photoshop software, about drawing tutorial?
PHP code encryption + extended decryption practice
Promise的使用场景
Shell basic operators -- relational operators
Fund raising, trading and registration
[micro services ~nacos] Nacos service providers and service consumers
Win10 cloud, add Vietnamese
相机投影矩阵计算
leetcode 1268. Search Suggestions System(搜索推荐系统)
Rescue system -- the application of read-write separation
uniapp 热更新后台管理
DHCP, TFTP Foundation