I want to generate a unique random integer (from 10000 to 99999) identity just by clean mySQL; any ideas?
I don\'t want to generate this number in php by cycling (ge
I worry about why you want to do this, but you could simply use:
SELECT FLOOR(RAND() * 1000000);
See the full MySQL RAND documentation for more information.
However, I hope you're not using this as a unique identifier (use an auto_increment attribute on a suitably large unsigned integer field if this is what you're after) and I have to wonder why you'd use MySQL for this and not a scripting language. What are you trying to achieve?