Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
15
Task/Loops-While/DuckDB/loops-while.duckdb
Normal file
15
Task/Loops-While/DuckDB/loops-while.duckdb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Start at `start`
|
||||
create or replace function task(start) as table (
|
||||
with recursive cte as (
|
||||
select start::BIGINT as n
|
||||
union all
|
||||
select
|
||||
n // 2 as n
|
||||
from cte
|
||||
where n > 0 -- "while n > 0"
|
||||
)
|
||||
from cte
|
||||
where n > 0 -- comment me out to include the last 0
|
||||
);
|
||||
|
||||
from task(1024);
|
||||
Loading…
Add table
Add a link
Reference in a new issue