I got program for Prime which gives only 2 as output. It should give me all based on java program I wrote.
Here is SQL I have created for Prime numbers. It is in SQL Ser
To answer the question you asked:
Can you please let me know the issue in this code?
The problem with your code is that you never reset @i back to 1 when you iterate to the next value of @j.
@i
@j
... END SET @i = 1 --add this line to fix it SET @j += 1 ...