gpt4 book ai didi

MySQL multiple Inner Join 帮助 - 1064

转载 作者:太空宇宙 更新时间:2023-11-03 11:04:32 24 4
gpt4 key购买 nike

也许是深夜,或者我没有喝足够的咖啡,但我似乎无法理解为什么我的 MySQL 语句是 1064'ing。

enter image description here

伪代码:

Get the id of the latest event happening, then join it with all guests that are linked (attending) that event retrieving their first and second names.

数据库

SELECT event.id, link.event_id, link.guests_id, guests.id, guests.first_name, guests.second_name 
FROM event
INNER JOIN link
ON event.id =link.event_id;
INNER JOIN guests
ON link.guests_id = guest.id;
ORDER BY event.date DESC
LIMIT 1

谢谢!

最佳答案

从语句中删除 ; 以使其工作。

; 是分隔符,数据库引擎认为您的查询在 ; 上结束并且不完整

关于MySQL multiple Inner Join 帮助 - 1064,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12903271/

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