gpt4 book ai didi

mysql - 连接的正确语法

转载 作者:行者123 更新时间:2023-11-29 06:56:37 24 4
gpt4 key购买 nike

我的 phpmyadmin 语法有问题。这是我的查询:

SELECT
CONCAT_WS(',', visitor_name, visitor_email, visitor_phone) AS visitor_info,
session_geoip_country,
session_geoip_city,
visitor_chats_count,
agents_names,
chat_id,
SUBSTRING( visitor_description, 1, 100 ) AS Manager_note
FROM
client_jivo_chat_finished
INNER JOIN
client_jivo_chat_finished_messages.timestamp, client_jivo_chat_finished_messages.message
ON
client_jivo_chat_finished_messages.chat_id = client_jivo_chat_finished.chat_id

错误是:

"#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 'ON client_jivo_chat_finished_messages.chat_id = client_jivo_chat_finished.chat_i' at line 8"

最佳答案

当您连接表列时,您的语法不正确。这是修改后的版本。希望这有效。

SELECT
CONCAT_WS(',', visitor_name, visitor_email, visitor_phone) AS visitor_info,
session_geoip_country,
session_geoip_city,
visitor_chats_count,
agents_names,
chat_id,
SUBSTRING( visitor_description, 1, 100 ) AS Manager_note
FROM
client_jivo_chat_finished
INNER JOIN
client_jivo_chat_finished_messages
ON
client_jivo_chat_finished_messages.chat_id = client_jivo_chat_finished.chat_id

您应该将两个表连接到一列上。只需删除这部分即可。

内连接
client_jivo_chat_finished_messages.timestamp,client_jivo_chat_finished_messages.message

关于mysql - 连接的正确语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45344073/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com