gpt4 book ai didi

mysql - #1064 - 您的 SQL 语法有错误 : What is wrong with this query?

转载 作者:行者123 更新时间:2023-11-29 12:36:43 26 4
gpt4 key购买 nike

请查看以下查询。

SELECT sub_words.idwords, words_inc.idArticle
(
SELECT sub0.idwords, SUBSTRING_INDEX(GROUP_CONCAT(sub1.idwords), ',', 10) AS excl_words, COUNT(sub1.idwords) AS older_words_cnt
FROM words_learned sub0
LEFT OUTER JOIN words_learned sub1
ON sub0.userId = sub1.userId
AND sub0.order < sub1.order
WHERE sub0.userId = 1
GROUP BY sub0.idwords
) sub_words
INNER JOIN words words_inc
ON sub_words.idwords = words_inc.idwords
LEFT OUTER JOIN words words_exc
ON words_inc.idArticle = words_exc.idArticle
AND FIND_IN_SET(words_exc.idwords, sub_words.excl_words)
WHERE words_exc.idwords IS NULL
ORDER BY older_words_cnt
LIMIT 100

这给出了错误

#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 'SELECT sub0.idwords, SUBSTRING_INDEX(GROUP_CONCAT(sub1.idwords), ',', 10) AS exc' at line 3

我单独检查了子查询,子查询没有错误!这里发生了什么?

最佳答案

您错过了 from 关键字

SELECT sub_words.idwords, words_inc.idArticle
FROM
( ...

关于mysql - #1064 - 您的 SQL 语法有错误 : What is wrong with this query?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26672987/

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