Home > database >  Mysql cycle is not only used in the process of storage, such as the while loop?
Mysql cycle is not only used in the process of storage, such as the while loop?

Time:10-02

Delimiter//
DECLARE num INT.
The SET of num=0;
WHILE num<1000 DO
INSERT INTO aaa VALUES (NULL, num);
The SET num=num + 1;
END the WHILE;
//
Delimiter.
Error:
[SQL]
DECLARE num INT.
The SET of num=0;
WHILE num<1000 DO
INSERT INTO aaa VALUES (NULL, num);
The SET num=num + 1;
END the WHILE;
;
(Err), 1064 - 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 num INT.
The SET of num=0;
WHILE num<1000 DO
INSERT INTO aaa VALUES (NULL, nu 'at line 1

CodePudding user response:

From his own experience, yes

CodePudding user response:

As the current version is like this
  • Related