I have been searching for this solution all over the internet and I haven't been able to find the solution for this:
I am trying to get the following code to run:
BEGIN
DECLARE @var int
SELECT @var =5
WHILE @var > 0
PRINT replicate('* ', @var)
SET @var = @var - 1
END
I have been trying to run this query, and I am getting the following message:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE @var int SELECT @var = 5
WHILE @var > 0 ' at line 1
I know that there have been iterated many times, but the solution discussed in other conversations have not been working on my console.