dimanche 30 avril 2017

Mysql random unique number not working

I'm trying to get a unique code number which doesn't exists in the "codes" table using a query I found in several other SO threads:

http://ift.tt/2qi1Yku http://ift.tt/2pugzGB

I'm currently trying to use this sqlfiddle:

http://ift.tt/2qhX5I8

With lots of issues:

  1. if no codes are in the table, I get no results at all.
  2. if there ARE any codes, the results is not unique. I can get a result already in the table...

Any idea on how to make this work?

Thanks!




Aucun commentaire:

Enregistrer un commentaire