Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to generate a unique random number in mysql

#query 
SELECT FLOOR(RAND() * 99999)
AS random_num 
FROM YourTableName
WHERE "random_num" 
NOT IN (
  SELECT YourColumnName FROM YourTableName) LIMIT 1
 
PREVIOUS NEXT
Tagged: #generate #unique #random #number #mysql
ADD COMMENT
Topic
Name
5+7 =