欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql-MYSQL连续左连接两张表报错

程序员文章站 2022-06-06 09:00:43
...
mysql数据库

SQL语句如下:
SELECT * FROM
channel AS a JOIN floors b ON a.ifloorid = b.id
join floors c on a.ofloorid = c.id
连续连接同一张表。
这个SQL语句直接放在mysql终端执行是没有问题的。
但是当用jdbc运行的时候。提示错误:
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 ''floors' b ON a.ifloorid = b.id JOIN 'floors' c ON a???ofloorid = c.id' at line 1

数据库版本是5.5,mysql的jar版本是5.1.6

相关标签: mysql 数据库