> ERROR 1235 (42000): This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
See https://dev.mysql.com/doc/refman/5.7/en/subquery-restriction...
> ERROR 1235 (42000): This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
See https://dev.mysql.com/doc/refman/5.7/en/subquery-restriction...
with page_numbers as (
select id from docs order by id limit 25 offset 50
)
select * from docs where id in (
select id from page_numbers
)[1] https://hakibenita.com/be-careful-with-cte-in-postgre-sql
This article is intended for PostgreSQL versions 11 and prior. Starting at version 12, PostgreSQL changed the way it treats CTE to prevent the issues described in this article.
I think for my package (the Laravel one) I'll have to hold off on that because CTEs only work with MySQL 8.0 and up. Also the Laravel query builder doesn't have methods to add CTEs, unfortunately.
I'm gonna noodle on this though, there's something nice about it.
https://dev.mysql.com/doc/refman/8.0/en/lateral-derived-tabl...
Prior to this you can emulate it with ROW NUMBER Window function in subquery, and this is what LATERAL gets turned into in many DB engines I believe
https://stackoverflow.com/questions/73127487/aws-athena-v2-p...
I made that choice for mine because I didn't want to pollute the `select` part of the developer's query to exclude the joined data. If we were writing the whole query from scratch we could, but not in the scenario where the package is actually used, unfortunately.