Fibonacci numbers in SQL
Example for versions
PostgreSQL 9.1
WITH RECURSIVE t(a,b) AS (
VALUES(1,1)
UNION ALL
SELECT b, a + b FROM t
WHERE b < 1000
)
SELECT array_to_string(array(SELECT a FROM t), ', ') || ', ...';
Comments
]]>blog comments powered by Disqus
]]>