### SQL: select t1.gid,t1.gname,t1.gvalue,t1.gtype, t1.gaddress,t1.gmembers, t1.gcode,t1.gphone, t2.cid ,t2.cname,t2.cgcode from group t1,customer t2 where t1.gcode = t2.cgcode and t1.gid=4;
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'group t1,customer t2
where t1.gcode = t2.cgcode and t1.gid=4' at line 5

经常我们会运行sql时会报sql语句出错,经常看半天发现sql语法没有错,后来发现是表名是关键字,例如group、user导致了sql出错

下次出错,一定要注意关键字

解决办法:

group两边加上·,就是esc下面那个键·,数字1左边那个·,变成·group·就好了

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 'group t1,customer t2的更多相关文章

  1. ERROR: 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 'type=InnoDB' at line 7

    问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...

  2. C# Mysql 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 ????

    有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...

  3. MySql 执行语句错误 Err] 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

    关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual ...

  4. 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 '

    mysql中如果字段使用了关键字,在插入和更新时会提示 You have an error in your SQL syntax; check the manual that corresponds ...

  5. MySQLSyntaxErrorException: 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 ...

    下面是我update数据库时打印出来的异常: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSynt ...

  6. 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 'like '%逸%'' at line 1

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-/ ...

  7. 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 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1

    mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...

  8. 解决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 'order (order_name, customer)

    在学习hibernate一对多映射关系时,根据视频学习的时候,例子是顾客和订单的问题,一个顾客有多个订单.按照视频中的敲代码出现了You have an error in your SQL synta ...

  9. mybatis批量更新update-设置多个字段值 报错 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

    mybatis批量更新update-设置多个字段值 2016年08月01日 12:49:26 姚一号 阅读数:29539 标签: mysql mybatis批量更新批量更新allowMultiQuer ...

随机推荐

  1. Lock和Synchronized

    1.synchronized无法判断是否获取锁的状态,Lock可以判断是否获取锁2.Lock中的某些锁允许对共享资源的并发访问,如ReadWriteLock读写锁,readLock()获取读锁,wri ...

  2. JAVA学习笔记 (一、入门及前期准备)

    博主本来只是会一点python,但是换了新公司这边用的java,边学习边总结吧,共勉之. 一.认识 java (1)java分为三类 JavaSE 基础核心 JaveEE web方向(企业版) Jav ...

  3. python学习笔记4-切片

    # 以list为例子,对tuple的切片类似 L = ['a','b','c','d','e'] L[1:3] # ['b', 'c'] # 1.起始.末尾切片可省略 L[:3] # ['a', 'b ...

  4. JAVA中使用alibaba fastjson实现JSONObject、Object、Json字符串的转换

    JAVA中使用alibaba fastjson实现JSONObject.Object.Json字符串的转换 Object转JSON字符串:String jsonStr = JSONObject.toJ ...

  5. vi命令设置行号

    1. :set nu :显示行号

  6. 24.C# Lambda表达式

    1.Lambda表达式的含义 Lambda表达式是C#3.0引入的一种结构,使用它可以简化C#编程. 2.Lambda表达式与匿名方法 我们知道匿名方法可用于事件处理,如下delegate声明了一个匿 ...

  7. The world is in my hands

    Null项 其实我还是比较希望你能理解我的心情 无聊666回味

  8. 《linux就该这么学》第十一节课: 第九章,网卡绑定与sshd服务

    8.4.服务的访问控制列表 TCPwrappers是RHEL7中默认启用的流量监控程序,能够对服务做出允许或拒绝. TCPwrappers服务由两个文件控制:  /etc/hosts.allow    ...

  9. PHP 类的命名空间 和自动载入

    PHP 类的自动载入有两种方法,__autoload() 和 spl_autoload_register() ,就是在PHP代码中new一个类的时候,会自动触发,将类的类名包括命名空间作为参数传进入方 ...

  10. Fiddler抓包【3】_设置断点修改

    1. 断点修改Request 1.1.Request全部中断 设置中断:Rules---> Automatic Breakpoints--->Before Requests 取消中断:Ru ...