LEAVE with Label out of an inner loop : LEAVE « Procedure Function « MySQL Tutorial






mysql>
mysql> delimiter $$
mysql>
mysql> CREATE PROCEDURE myProc()
    -> BEGIN
    ->     DECLARE i,j INT DEFAULT 1;
    ->     outer_loop: LOOP
    ->          SET j=1;
    ->          inner_loop: LOOP
    ->               SELECT CONCAT(i," times ", j," is ",i*j);
    ->               SET j=j+1;
    ->               IF j>12 THEN
    ->                    LEAVE inner_loop;
    ->               END IF;
    ->          END LOOP inner_loop;
    ->          SET i=i+1;
    ->          IF i>12 THEN
    ->               LEAVE outer_loop;
    ->          END IF;
    ->     END LOOP outer_loop;
    ->
    ->
    ->
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> delimiter ;
mysql> call myProc();
+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 1 is 1                    |
+-----------------------------------+
1 row in set (0.02 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 2 is 2                    |
+-----------------------------------+
1 row in set (0.02 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 3 is 3                    |
+-----------------------------------+
1 row in set (0.02 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 4 is 4                    |
+-----------------------------------+
1 row in set (0.03 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 5 is 5                    |
+-----------------------------------+
1 row in set (0.03 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 6 is 6                    |
+-----------------------------------+
1 row in set (0.03 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 7 is 7                    |
+-----------------------------------+
1 row in set (0.03 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 8 is 8                    |
+-----------------------------------+
1 row in set (0.03 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 9 is 9                    |
+-----------------------------------+
1 row in set (0.38 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 10 is 10                  |
+-----------------------------------+
1 row in set (0.38 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 11 is 11                  |
+-----------------------------------+
1 row in set (0.38 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 1 times 12 is 12                  |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 1 is 2                    |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 2 is 4                    |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 3 is 6                    |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 4 is 8                    |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 5 is 10                   |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 6 is 12                   |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 7 is 14                   |
+-----------------------------------+
1 row in set (0.39 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 8 is 16                   |
+-----------------------------------+
1 row in set (0.41 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 9 is 18                   |
+-----------------------------------+
1 row in set (0.41 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 10 is 20                  |
+-----------------------------------+
1 row in set (0.41 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 11 is 22                  |
+-----------------------------------+
1 row in set (0.41 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 2 times 12 is 24                  |
+-----------------------------------+
1 row in set (0.78 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 1 is 3                    |
+-----------------------------------+
1 row in set (0.78 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 2 is 6                    |
+-----------------------------------+
1 row in set (0.78 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 3 is 9                    |
+-----------------------------------+
1 row in set (0.78 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 4 is 12                   |
+-----------------------------------+
1 row in set (0.78 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 5 is 15                   |
+-----------------------------------+
1 row in set (0.78 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 6 is 18                   |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 7 is 21                   |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 8 is 24                   |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 9 is 27                   |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 10 is 30                  |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 11 is 33                  |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 3 times 12 is 36                  |
+-----------------------------------+
1 row in set (0.80 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 1 is 4                    |
+-----------------------------------+
1 row in set (0.81 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 2 is 8                    |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 3 is 12                   |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 4 is 16                   |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 5 is 20                   |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 6 is 24                   |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 7 is 28                   |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 8 is 32                   |
+-----------------------------------+
1 row in set (1.22 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 9 is 36                   |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 10 is 40                  |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 11 is 44                  |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 4 times 12 is 48                  |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 1 is 5                    |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 2 is 10                   |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 3 is 15                   |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 4 is 20                   |
+-----------------------------------+
1 row in set (1.23 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 5 is 25                   |
+-----------------------------------+
1 row in set (1.64 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 6 is 30                   |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 7 is 35                   |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 8 is 40                   |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 9 is 45                   |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 10 is 50                  |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 11 is 55                  |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 5 times 12 is 60                  |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 1 is 6                    |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 2 is 12                   |
+-----------------------------------+
1 row in set (1.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 3 is 18                   |
+-----------------------------------+
1 row in set (1.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 4 is 24                   |
+-----------------------------------+
1 row in set (1.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 5 is 30                   |
+-----------------------------------+
1 row in set (1.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 6 is 36                   |
+-----------------------------------+
1 row in set (1.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 7 is 42                   |
+-----------------------------------+
1 row in set (1.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 8 is 48                   |
+-----------------------------------+
1 row in set (2.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 9 is 54                   |
+-----------------------------------+
1 row in set (2.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 10 is 60                  |
+-----------------------------------+
1 row in set (2.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 11 is 66                  |
+-----------------------------------+
1 row in set (2.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 6 times 12 is 72                  |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 1 is 7                    |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 2 is 14                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 3 is 21                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 4 is 28                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 5 is 35                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 6 is 42                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 7 is 49                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 8 is 56                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 9 is 63                   |
+-----------------------------------+
1 row in set (2.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 10 is 70                  |
+-----------------------------------+
1 row in set (2.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 11 is 77                  |
+-----------------------------------+
1 row in set (2.64 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 7 times 12 is 84                  |
+-----------------------------------+
1 row in set (2.64 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 1 is 8                    |
+-----------------------------------+
1 row in set (2.64 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 2 is 16                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 3 is 24                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 4 is 32                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 5 is 40                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 6 is 48                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 7 is 56                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 8 is 64                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 9 is 72                   |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 10 is 80                  |
+-----------------------------------+
1 row in set (2.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 11 is 88                  |
+-----------------------------------+
1 row in set (2.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 8 times 12 is 96                  |
+-----------------------------------+
1 row in set (2.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 1 is 9                    |
+-----------------------------------+
1 row in set (2.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 2 is 18                   |
+-----------------------------------+
1 row in set (3.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 3 is 27                   |
+-----------------------------------+
1 row in set (3.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 4 is 36                   |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 5 is 45                   |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 6 is 54                   |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 7 is 63                   |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 8 is 72                   |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 9 is 81                   |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 10 is 90                  |
+-----------------------------------+
1 row in set (3.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 11 is 99                  |
+-----------------------------------+
1 row in set (3.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 9 times 12 is 108                 |
+-----------------------------------+
1 row in set (3.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 1 is 10                  |
+-----------------------------------+
1 row in set (3.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 2 is 20                  |
+-----------------------------------+
1 row in set (3.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 3 is 30                  |
+-----------------------------------+
1 row in set (3.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 4 is 40                  |
+-----------------------------------+
1 row in set (3.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 5 is 50                  |
+-----------------------------------+
1 row in set (3.64 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 6 is 60                  |
+-----------------------------------+
1 row in set (3.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 7 is 70                  |
+-----------------------------------+
1 row in set (3.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 8 is 80                  |
+-----------------------------------+
1 row in set (3.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 9 is 90                  |
+-----------------------------------+
1 row in set (3.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 10 is 100                |
+-----------------------------------+
1 row in set (3.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 11 is 110                |
+-----------------------------------+
1 row in set (3.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 10 times 12 is 120                |
+-----------------------------------+
1 row in set (3.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 1 is 11                  |
+-----------------------------------+
1 row in set (3.67 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 2 is 22                  |
+-----------------------------------+
1 row in set (3.69 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 3 is 33                  |
+-----------------------------------+
1 row in set (3.69 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 4 is 44                  |
+-----------------------------------+
1 row in set (3.69 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 5 is 55                  |
+-----------------------------------+
1 row in set (3.69 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 6 is 66                  |
+-----------------------------------+
1 row in set (3.69 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 7 is 77                  |
+-----------------------------------+
1 row in set (3.69 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 8 is 88                  |
+-----------------------------------+
1 row in set (4.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 9 is 99                  |
+-----------------------------------+
1 row in set (4.14 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 10 is 110                |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 11 is 121                |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 11 times 12 is 132                |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 1 is 12                  |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 2 is 24                  |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 3 is 36                  |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 4 is 48                  |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 5 is 60                  |
+-----------------------------------+
1 row in set (4.16 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 6 is 72                  |
+-----------------------------------+
1 row in set (4.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 7 is 84                  |
+-----------------------------------+
1 row in set (4.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 8 is 96                  |
+-----------------------------------+
1 row in set (4.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 9 is 108                 |
+-----------------------------------+
1 row in set (4.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 10 is 120                |
+-----------------------------------+
1 row in set (4.17 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 11 is 132                |
+-----------------------------------+
1 row in set (4.66 sec)

+-----------------------------------+
| CONCAT(i," times ", j," is ",i*j) |
+-----------------------------------+
| 12 times 12 is 144                |
+-----------------------------------+
1 row in set (4.66 sec)

Query OK, 0 rows affected (4.66 sec)

mysql> drop procedure myProc;
Query OK, 0 rows affected (0.00 sec)

mysql>








11.17.LEAVE
11.17.1.LEAVE to a label
11.17.2.LEAVE with Label out of an inner loop