Created
March 27, 2020 12:10
-
-
Save Foadsf/7dcefc25d70a8f9147d10ce2ed881721 to your computer and use it in GitHub Desktop.
MySQL While Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @year = 2020; | |
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS reapeatEvent; | |
CREATE PROCEDURE reapeatEvent() | |
BEGIN | |
WHILE (@year < 2030) DO | |
SET @year = @year + 1; | |
END WHILE; | |
END; $$ | |
DELIMITER ; | |
CALL reapeatEvent(); | |
SELECT @year; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment