Fizzbuzz With Common Table Expressions
with recursive fizzbuzz (num,val) as (
select 0, ''
union
select (num + 1),
case
when (num + 1) % 15 = 0 then 'fizzbuzz'
when (num + 1) % 5 = 0 then 'buzz'
when (num + 1) % 3 = 0 then 'fizz'
else (num + 1)::text
end
from fizzbuzz
where num < 100
)
select val from fizzbuzz where num > 0;PreviousGet A Quick Approximate Count Of A TableNextFind Duplicate Records In Table Without Unique Id
Last updated