Last active
March 22, 2020 16:06
-
-
Save skazhikadyadya/5c78f8cfffab22aa08a1b8c1146af1f6 to your computer and use it in GitHub Desktop.
Random strings from DB #mysql
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
SELECT * FROM table AS r1 | |
JOIN (SELECT (RAND()*(SELECT MAX(id)-MIN(id) FROM table) + | |
(SELECT MIN(id) FROM table)) AS id) AS r2 | |
WHERE r1.id >= r2.id ORDER BY r1.id ASC LIMIT 300 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment