How to Generate unique random number?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mgdvicky
    New Member
    • Feb 2014
    • 12

    #1

    How to Generate unique random number?

    Can someone tell me a good method for automatically placing a unique random number in a mysql database table when a new record is created.
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Create a trigger, and fill the field with the output of the function RAND()

    Comment

    • mHealth
      New Member
      • Jun 2014
      • 13

      #3
      You may use ID fields, which database are you using?

      Comment

      Working...