Last active
October 17, 2018 20:20
-
-
Save mhkeller/1ed0838e66ae9be6e44fe9e4c64c1d5f 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
CREATE OR REPLACE FUNCTION rando(anyarray) RETURNS any AS $BODY$ | |
SELECT unnest($1::anyarray ORDER BY RANDOM()) LIMIT 1 | |
$BODY$ | |
LANGUAGE SQL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment