News for hackers. Stuff that matters.
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model by ComputerGuru on Monday February 05, 2024 @02:34PM (#39265904)
LATERAL first available in PostgreSQL 9.3 (2013), but still not available in SQLite.
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model by fifilura on Monday February 05, 2024 @02:40PM (#39265998)
SQLite has RECURSIVE, so you can generate a table with all numbers using something like:

WITH RECURSIVE cnt(x) AS ( SELECT 1 UNION ALL SELECT x+1 FROM cnt LIMIT 5 ) SELECT x FROM cnt;

And then do a regular CROSS JOIN on that table.

Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model by ComputerGuru on Monday February 05, 2024 @02:59PM (#39266278)
But generating a table with all numbers was just a throwaway example of the LATERAL JOIN syntax/use, and (hopefully) not what you'd actually use it for in the real world.

It's not clear to me that (mathematically) a lateral join can be reduced to a recursive cte (and if the performance of a recursive cte would be acceptable for the cases where it does work as a substitute).