Created
August 22, 2016 00:53
-
-
Save josephrexme/832bc820e428aef431e09e90f214a687 to your computer and use it in GitHub Desktop.
Fizzbuzz in postgresql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select generate_series as num, | |
case when generate_series % 15 = 0 | |
then 'fizzbuzz' | |
when generate_series % 3 = 0 | |
then 'fizz' | |
when generate_series % 5 = 0 | |
then 'buzz' | |
else '' end | |
as fizzbuzz | |
from generate_series(1, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment