I make a site and provide each user with a unique identifier after registration. The unique identifier should start with 80001. But now I want the second user to have identifier 80002, the third user to 80003. Could this be possible in SQL, because I only want to update only the last 3 digits. I tried to do this through the sequence, but could not do it.
The way to do this is:
ALTER TABLE tbl AUTO_INCREMENT = 80000;
, . -, , , . -, 999 , , . -, , . . , , .
:
ALTER tbl MODIFY `rowid` int(11) NOT NULL AUTO_INCREMENT;
UPDATE tbl SET `rowid` = `rowid`-80000;
ALTER TABLE student AUTO_INCREMENT=80000;
,
CREATE TABLE `student ` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`rowid`), UNIQUE KEY `rowid_UNIQUE` (`rowid`) ) ENGINE=InnoDB AUTO_INCREMENT=80000 DEFAULT CHARSET=latin1;
Source: https://habr.com/ru/post/1533464/More articles:Password encryption algorithm throws an exception when converting to JS from PHP - javascripthow to change ios7 interactivePopGestureRecognizer scope? - ios7How to use synchronization with an application created using release relx assembler? - erlangImage name for retina only? - iosReturning a string from the C library to OCaml using CTypes and Foreign - ocamlКак получить имя контакта от его номера - androidSending a Multipart / Form request with multiple parameters? - androidBlue highlight in drop-down list when choosing any value in Windows 8 phone - html5Как реализовать проверку вирусов при загрузке файла в приложении Spring 3 MVC - javaWindows Phone 8 highlights colors in input field - htmlAll Articles