Created
October 24, 2012 02:21
-
-
Save shahoxo/3943342 to your computer and use it in GitHub Desktop.
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
delimiter // | |
CREATE PROCEDURE Bonanza() | |
BEGIN | |
SELECT name FROM user WHERE id = TRUNCATE(RAND() * ( | |
SELECT MAX(id) FROM user | |
)+ .9, 0); | |
END | |
// | |
delimiter ; |
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
CREATE TABLE user ( | |
id TINYINT AUTO_INCREMENT, | |
name VARCHAR(100), | |
PRIMARY KEY(id) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ mysql