Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Last active December 21, 2015 11:49
Show Gist options
  • Select an option

  • Save ryaan-anthony/6301380 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/6301380 to your computer and use it in GitHub Desktop.
delimiter ;;
drop procedure if exists wtfman;;
create procedure wtfman()
begin
SET @count = 0;
WHILE @count < 10 DO
SELECT @var := id FROM source ORDER BY RAND() LIMIT 1;
INSERT INTO test VALUES (@var);
SET @count = @count + 1;
END WHILE;
end
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment