





















通过SqlServer的Common Table Expressions (CTE)可以进行递归计算。
参见Using Common Table Expressions 和 Recursive Queries Using Common Table Expressions
通过CTE计算Fibonacci
WITH Fib(a, b)
AS(
SELECT 0,1
UNION all
SELECT b, a+b
FROM Fib
WHERE b < 10
)
SELECT * FROM Fib
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。