Here's one from [BeyondRelational][1] that is good for the 1st 70 numbers. It succumbs to rounding errors after that, so I limited the output.
SELECT
FLOOR(POWER(( 1 + SQRT(5) ) / 2.0, number) / SQRT(5) + 0.5) AS fib_number
FROM master..spt_values
WHERE TYPE = 'p' AND number BETWEEN 1 AND 70
Stumbled across a [list][2] of the first 1001 Fibonacci numbers, while I was out there.
[1]: http://beyondrelational.com/blogs/madhivanan/archive/2009/09/01/generate-fibonacci-series-no-loop-no-recursion.aspx
[2]: http://www.fullbooks.com/The-first-1001-Fibonacci-Numbers.html
↧