Skip to content

Instantly share code, notes, and snippets.

@ethangardner
Last active October 7, 2015 00:27
Show Gist options
  • Save ethangardner/3076388 to your computer and use it in GitHub Desktop.
Save ethangardner/3076388 to your computer and use it in GitHub Desktop.
SQL - order by random
SELECT * FROM table ORDER BY NEWID()
-- mysql version
SELECT * FROM table ORDER BY uuid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment