Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql多连接语法错误_Mysql_Sql - Fatal编程技术网

Mysql多连接语法错误

Mysql多连接语法错误,mysql,sql,Mysql,Sql,我是mysql新手,在这个查询中遇到了一些问题 考虑这个查询: SELECT a.group_message_id, a.scheduled_date, b.message, c.phone_number, d.group_name FROM schedule AS a JOIN group_message AS b ON a.group_message_id = b.id, JOIN phonenumber AS c ON c.id = a.phonenumber_id

我是mysql新手,在这个查询中遇到了一些问题

考虑这个查询:

SELECT a.group_message_id, a.scheduled_date, b.message, c.phone_number, d.group_name
    FROM schedule AS a
    JOIN group_message AS b ON a.group_message_id = b.id,
    JOIN phonenumber AS c ON c.id = a.phonenumber_id,
    JOIN group_table AS d ON d.group_id = a.group_id
    WHERE a.status = 'unsent'
以及此错误消息:

您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本,以便使用正确的语法 近'JOIN phonenumber AS c ON c.id=a.phonenumber\u id,JOIN 第4行的d'组表格

我需要你帮我弄清楚这句话到底是怎么回事。另外,如果你能告诉我其他的和“适当的”方法,我会非常感激


最后,如果没有足够的时间,是否有一个有效的资源,我可以从mysql的基础知识中学习。请共享。

删除join语句中的逗号

JOIN group_message AS b ON a.group_message_id = b.id, -- <<== HERE
JOIN phonenumber AS c ON c.id = a.phonenumber_id,     -- <<== HERE
JOIN group_table AS d ON d.group_id = a.group_id

删除join语句中的逗号

JOIN group_message AS b ON a.group_message_id = b.id, -- <<== HERE
JOIN phonenumber AS c ON c.id = a.phonenumber_id,     -- <<== HERE
JOIN group_table AS d ON d.group_id = a.group_id

你不应该用逗号

只需检查语法即可

示例语法

SELECT  column_list FROM  table1 JOIN table2 ON condition JOIN table3 ON condition WHERE condition

你不应该用逗号

只需检查语法即可

示例语法

SELECT  column_list FROM  table1 JOIN table2 ON condition JOIN table3 ON condition WHERE condition