I know that auto_increment automatically assigns a primary key value to each new row that you insert in the table. Is there some default value that you can assign an integer primary key that results in a random number with each new insertion? Something like DEFAULT_VALUE = FLOOR(RAND() * (1000000-1)) ? I know that this is probably a very banal and stupid question, but I will be grateful for any help in advance! Thanks!
DEFAULT_VALUE = FLOOR(RAND() * (1000000-1))
Why not just use a UUID ?
Alternatively, why not let id do its thing, style AUTO_INCREMENT and create a secondary column that is randomly generated and indexed by UNIQUE , so it serves as a secondary primary?
id
AUTO_INCREMENT
UNIQUE
Source: https://habr.com/ru/post/1489283/More articles:python word frequency not working - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1489279/how-to-add-comments-to-fenced-code-block-within-doxygen-documentation&usg=ALkJrhhPdh8XSD8h1Cnj6JHpxYkKa2qMjgIs it possible to use Perforce with TFS as a continuous integration server? - tfsUsing Php value in jQuery script - variablesusing perforce with a core command server - tfsLoad Testing for WCF Services - asp.nethttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1489285/getting-a-too-many-values-to-unpack-value-error&usg=ALkJrhiB6LPmNaSIiljG8u7mC428cLbZoAHow to understand python function description? - pythonParsing the name and degree? - pythonWhat is the "iOS rich content paste cardboard type" when copying with Safari? - iosAll Articles