Created
September 7, 2022 12:54
-
-
Save wriglz/74e8109c01485b9b96c60aca67ec9dcf to your computer and use it in GitHub Desktop.
SQL to generate a random number within a specified <min> <max> range
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
-- Generate a random number within a specified <min> <max> range | |
SELECT | |
CAST(<min> + RAND() * (<max> - <min>) AS INT) AS random_number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment