Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 647d432

Browse files
authored
Fibonacci sequence numbers with recursive in PostgreSQL
1 parent 25d2029 commit 647d432

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,18 @@ select max(x), count(x)
11771177
from t
11781178
```
11791179

1180+
[Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_sequence) numbers with recursive in PostgreSQL
1181+
```
1182+
with recursive r(a, b) as (
1183+
select 0::int, 1::int
1184+
union all
1185+
select b, a + b
1186+
from r
1187+
where b < 1000
1188+
)
1189+
select a from r;
1190+
```
1191+
11801192
## Модификация пользовательских данных (DML)
11811193

11821194
### Как добавить или обновить записи одним запросом (UPSERT)?

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /