Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save derak-kilgo/84d5e16c93ebfab4df340f513a97209f to your computer and use it in GitHub Desktop.
Save derak-kilgo/84d5e16c93ebfab4df340f513a97209f to your computer and use it in GitHub Desktop.
MySql random word function based on Lorem Ipsum text
DROP FUNCTION IF EXISTS random_word;
CREATE FUNCTION random_word ()
RETURNS TEXT
RETURN (ELT( FLOOR(1 + (RAND() * (100-1))),
'Lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'Integer', 'nec',
'odio', 'Praesent', 'libero', 'Sed', 'cursus', 'ante', 'dapibus', 'diam', 'Sed', 'nisi',
'Nulla', 'quis', 'sem', 'at', 'nibh', 'elementum', 'imperdiet', 'Duis', 'sagittis', 'ipsum',
'Praesent', 'mauris', 'Fusce', 'nec', 'tellus', 'sed', 'augue', 'semper', 'porta', 'Mauris',
'massa', 'Vestibulum', 'lacinia', 'arcu', 'eget', 'nulla', 'Class', 'aptent', 'taciti', 'sociosqu',
'ad', 'litora', 'torquent', 'per', 'conubia', 'nostra', 'per', 'inceptos', 'himenaeos', 'Curabitur',
'sodales', 'ligula', 'in', 'libero', 'Sed', 'dignissim', 'lacinia', 'nunc', 'Curabitur', 'tortor',
'Pellentesque', 'nibh', 'Aenean', 'quam', 'In', 'scelerisque', 'sem', 'at', 'dolor', 'Maecenas',
'mattis', 'Sed', 'convallis', 'tristique', 'sem', 'Proin', 'ut', 'ligula', 'vel', 'nunc',
'egestas', 'porttitor', 'Morbi', 'lectus', 'risus', 'iaculis', 'vel', 'suscipit', 'quis', 'luctu'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment