General FizzBuzz: Difference between revisions

m (→‎{{header|Tailspin}}: stricter typing and avoid new string type match)
Line 3,765:
19
Buzz
</pre>
 
=={{header|SQL}}==
{{works with|ORACLE 19c}}
This is not a particularly efficient solution, but it gets the job done.
 
<lang SQL>
/*
This code is an implementation of "General FizzBuzz" in SQL ORACLE 19c
*/
select lpad( nvl( case when mod(level, 3) = 0 then 'Fizz' end
|| case when mod(level, 5) = 0 then 'Buzz' end
|| case when mod(level, 7) = 0 then 'Baxx' end
, level)
,12) as output
from dual
connect by level <= 107
;
/
</lang>
 
{{out}}
<pre>
1
2
Fizz
4
Buzz
Fizz
Baxx
8
Fizz
Buzz
11
Fizz
13
Baxx
FizzBuzz
16
17
Fizz
19
Buzz
FizzBaxx
...
101
Fizz
103
104
FizzBuzzBaxx
106
107
</pre>
 
Anonymous user