Created
November 27, 2018 19:00
-
-
Save spiderbites/5d7cf0caca20906c4f3973abfac6aa25 to your computer and use it in GitHub Desktop.
Redshift function - random_between
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 or replace function random_between(INT, INT) | |
returns INT | |
volatile | |
as $$ | |
select floor(random() * ($2 - $1 + 1) + $1) :: int; | |
$$ language sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment