3 ms·
you have to use it since PostgreSQL does not support limit within a with expression.
by schoetbi 6y ago
you have to use it since PostgreSQL does not support limit within a with expression.
- jolmg 6y agoYou can use a with-expression. It's true that you can't use `limit` to limit it, but you can use a `where` condition. This is equivalent to cribwi's example: WITH RECURSIVE t AS ( SELECT 0 id UNION ALL SELECT id + 1 FROM t WHERE id < 1000000 ) SELECT id, random() FROM t; It returns 1000001 rows, but so does cribwi's.