Created
May 2, 2013 02:58
-
-
Save mikeminutillo/5499869 to your computer and use it in GitHub Desktop.
An implementation of FizzBuzz in T-SQL
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
with t as (select 1 x union all select x + 1 from t where x < 100) | |
select case | |
when x % 3 = 0 AND x % 5 = 0 then 'FizzBuzz' | |
when x % 3 = 0 then 'Fizz' | |
when x % 5 = 0 then 'Buzz' | |
else CAST(x as varchar) | |
end | |
from t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment