Skip to content

Instantly share code, notes, and snippets.

@bjethwan
Created March 25, 2018 07:09
Show Gist options
  • Save bjethwan/ba0c6a202b7458599cb1fef0362311b9 to your computer and use it in GitHub Desktop.
Save bjethwan/ba0c6a202b7458599cb1fef0362311b9 to your computer and use it in GitHub Desktop.
DELIMITER //
CREATE PROCEDURE Whileloop()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i < 6 DO
SELECT POW(i, 2);
SET i = i + 1;
END WHILE;
END//
DELIMITER ;
CALL Whileloop();
DROP PROCEDURE Whileloop;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment