这意味着 question_id与 question_id6
有 84% 的相似性10
。并且有 12 个类似 question_id 的问题6
。
我只是最相关的问题,或前 7 个相关问题。
我看过Mysql delete order by 并尝试过:
DELETE FROM exam_relatedquestion
WHERE
`exam_relatedquestion`.id IN (
SELECT
`exam_relatedquestion`.id
FROM
(
SELECT `exam_relatedquestion`.id
FROM `exam_relatedquestion`
GROUP BY
`exam_relatedquestion`.from_question_id_id
ORDER BY
`exam_relatedquestion`.similarity DESC
LIMIT 7
) a
)
但错误信息是:
[Err] 1055 - SELECT 列表的表达式 #1 不在 GROUP BY 子句中,并且包含在功能上不依赖于 GROUP BY 子句中的列的非聚合列“den.exam_relatedquestion.id”;这与 sql_mode=only_full_group_by 不兼容
如何删除与问题无关的前 7 个行?