declare i int ;
/* SQL Error: 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 i int' at line 1 */
How to declare variable?
That declare syntax is only valid in stored programs, see the MySQL docs.
To define a variable in a session you have to do it this way:
To define a variable in a session you have to do it this way:
SET @myvar=1;
SELECT @myvar;
Please login to leave a reply, or register at first.