vendredi 21 avril 2017

Will this query generate distinct random numbers Mysql?

I have written the following query in Mysql:

SELECT distinct LPAD(FLOOR(RAND() * 999999999),9,0) AS random_num
FROM test;

If I have say 100000 records in my table test, then will this query always give me 100000 distinct numbers? If not, why?

Aucun commentaire:

Enregistrer un commentaire