我想显示前 15 个使用过的标题,以及相应的文章数量。在这一点上,它正在工作。但是,现在我想添加另一个“OR 语句”,这是查询不断加载的地方(直到我手动终止它)。
工作查询:
SELECT
title,
title as t,
(SELECT count(id) FROM articles WHERE title = t) as nr
FROM
articles
GROUP BY
title
ORDER BY
nr DESC
LIMIT
15
查询失败:
SELECT
title,
title as t,
(SELECT count(id) FROM articles WHERE title = t OR title = 'Example title') as nr
FROM
articles
GROUP BY
title
ORDER BY
nr DESC
LIMIT
15
有人知道为什么这个查询失败了吗?