-1 to 100 in SQL and display 'Fizz' if the number is divisible by 3 'Buzz' if divisible by 5 and 'FizzBuzz' if divisible by both. below is my code
select
Case when Remainder (rownum,3)=0 then 'Fizz'
when Remainder (rownum,5)=0 then 'Buzz'
when (remainder (rownum,3)=0 and remainder(ROWNUM,5) = 0) then 'FizzBuzz'
else rownum end
from DUAL
Connect by level <=100;
It gives me error - ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
Error at Line: 5 Column: 18