Skip to content

Instantly share code, notes, and snippets.

@andreydjason
Created May 21, 2012 13:17
Show Gist options
  • Save andreydjason/2762267 to your computer and use it in GitHub Desktop.
Save andreydjason/2762267 to your computer and use it in GitHub Desktop.
MySQL SQL Utils
# Return the columns with status of table, including the Auto_Increment value:
=> SHOW TABLE STATUS LIKE '<table_name>'
# Return a random number:
1) => (<MinRange> + FLOOR(RAND() * (<MaxRange> - <MinRange> + 1))) as random_number
2) => FLOOR(<MinRange> + RAND() * <MaxRange>) as random_number
* Replace the values in <these_tag_type> whitin your values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment