当前位置:网站首页>已解决SQL_ERROR_INFO: “You have an error in your SQL syntax; check the manual that corresponds to your
已解决SQL_ERROR_INFO: “You have an error in your SQL syntax; check the manual that corresponds to your
2022-07-16 12:33:00 【无 羡ღ】
已解决SQL_ERROR_INFO: “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 ‘.difficult_level\n (count(q1.question_id)/count(distinct q1.device_id)) as avg’ at line 3”
报错代码
我的代码:
select
u.university
q2.difficult_level
(count(q1.question_id)/count(distinct q1.device_id)) as avg_answer_cnt
from
user_profile as u
join question_practice_detail as q1 on u.device_id = q1.device_id
join question_detail as q2 on q1.question_id = q2.question_id
where
university = '山东大学'
group by q2.difficult_level
报错信息:
SQL_ERROR_INFO: “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 ‘.difficult_level\n (count(q1.question_id)/count(distinct q1.device_id)) as avg’ at line 3”

报错原因
报错内容翻译:
SQL\u ERROR\u INFO:“您的SQL语法有错误;请查看与您的MySQL server版本对应的手册,以了解要在附近使用的正确语法。第3行的平均值为\u级(count(q1.question\u id)/count(distinct q1.device\u id))
报错原因:您的SQL语法有错误;请查看与您的MySQL server版本对应的手册
解决方法
SQL_ERROR_INFO: "You have an error in your SQL syntax; check the manual that corresponds to your...类似这种开头的错误,这种错误一般情况下就是多个标点符号啊,字段名字写错了等一系列因为手打失误出现的错误。
检查一下代码发现少了两个逗号:

修改代码后运行成功:
select
u.university,
q2.difficult_level,
(count(q1.question_id)/count(distinct q1.device_id)) as avg_answer_cnt
from
user_profile as u
join question_practice_detail as q1 on u.device_id = q1.device_id
join question_detail as q2 on q1.question_id = q2.question_id
where
university = '山东大学'
group by q2.difficult_level
边栏推荐
- 一文带你浏览Graph Transformers
- (手工)【sqli-labs46、47】order by 注入、报错回显、POST注入、数字/字符型
- Given an integer array nums and a target value target, find the two integers whose sum is the target value in the array, and return their array subscripts.
- 06.01 二叉树存储
- Flink1.7 from installation to experience
- How to reinstall win10? One click reinstallation of graphic version of win10 tutorial
- [UVM] Axi VIP uses the register model to access registers, and the ID is fixed to 0
- 可爱的小猫咪
- About the problem that the valueint of cjson exceeds the integer range
- Find prime number
猜你喜欢

V831——AprilTag标签识别

Data Lake (11): Iceberg table data organization and query

HCIA-R&S自用笔记(8)IP地址基础、子网掩码、子网划分

2022年山东省安全员C证考试题库及答案

Scope and constructor details

一文带你浏览Graph Transformers
![[paper reading] multi task attention based semi supervised learning for medical image segmentation](/img/5d/52cc0fb857d088761e4232c6867ffb.png)
[paper reading] multi task attention based semi supervised learning for medical image segmentation

QT4:从零开始做“工作日记”开发(1)-Worklog项目

2022年G3锅炉水处理考试题库及模拟考试

06.01 binary tree storage
随机推荐
文件解析漏洞详解
[论文阅读] Multi-task Attention-Based Semi-supervised Learning for Medical Image Segmentation
SWD/JTAG Communication Failure和No Target Connected
2022年山东省安全员C证考试题库及答案
Notes on deep learning - regularization, optimizer, linear regression, logistic regression
哪些快速提供开发效率的vite插件推荐
常用英文学术论文写作词汇与表达
渗透测试工具 - msf生成后门免杀
一 kernel编译系统概述
[CVA valuation training camp] how to quickly read the annual reports of listed companies (Lecture 1)
V831——条形码识别
The new book is on the market | C language classic textbook supporting "exercise solutions", and the original book has been printed a total of 100000+
数据湖(十一):Iceberg表数据组织与查询
[paper reading] deep transformer q-networks for partially observable reinforcement learning
Use of typescript classes
V831 - apriltag tag identification
[动态规划]DP19 最长公共子序列(一)-中等
Tcp/ip protocol of network principle
【踩坑合辑】7.14
V831 - barcode recognition