Jika rentang Anda kecil, dan Anda memiliki tabel bilangan bulat , pendekatan naif mungkin berhasil:
SELECT GROUP_CONCAT(i SEPARATOR '|')
FROM ( SELECT i
FROM ( SELECT i
FROM integers
WHERE i BETWEEN 1 AND 50
ORDER BY RAND()
LIMIT 5) sort_these_five
ORDER BY i) concat_these_five;