Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
16
Task/Loops-Do-while/DuckDB/loops-do-while.duckdb
Normal file
16
Task/Loops-Do-while/DuckDB/loops-do-while.duckdb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
create or replace function do_while(init) as table (
|
||||
with recursive cte as (
|
||||
select init+1 as value -- Increment unconditionally
|
||||
union all -- Loop
|
||||
select value+1 as value -- Each time through the loop, add 1 to the value then print it.
|
||||
from cte
|
||||
where value % 6 != 0 -- "while value mod 6 is not equal to 0"
|
||||
)
|
||||
from cte order by value
|
||||
);
|
||||
|
||||
# The task
|
||||
from do_while(0);
|
||||
|
||||
# Also check that the loop executes at least once.
|
||||
from do_while(-1);
|
||||
Loading…
Add table
Add a link
Reference in a new issue