如何在 SQL IN operator 子查询中使用 limit 和 offset?
How to use limit and offset in SQL IN operator subquery?
例如:
SELECT groupdate
FROM ccl9t_az_articles
WHERE groupdate IN (
SELECT * FROM ccl9t_az_articles LIMIT 3 OFFSET 2
)
GROUP BY groupdate
正确的方法是什么?
在错误显示上面的代码returns下面
MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
问题已通过将以上代码更改为:
得到解决
SELECT * FROM ccl9t_az_articles as group1 INNER JOIN (
SELECT groupdate FROM ccl9t_az_articles LIMIT 3 OFFSET 2
)
as group2 ON group1.groupdate = group2.groupdate GROUP BY group1.groupdate
例如:
SELECT groupdate
FROM ccl9t_az_articles
WHERE groupdate IN (
SELECT * FROM ccl9t_az_articles LIMIT 3 OFFSET 2
)
GROUP BY groupdate
正确的方法是什么?
在错误显示上面的代码returns下面
MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
问题已通过将以上代码更改为:
得到解决 SELECT * FROM ccl9t_az_articles as group1 INNER JOIN (
SELECT groupdate FROM ccl9t_az_articles LIMIT 3 OFFSET 2
)
as group2 ON group1.groupdate = group2.groupdate GROUP BY group1.groupdate