Home>

Just started learning sqlite3, a question appeared. I have a users table, each has a key id, I wrote it down as PRIMARY KEY. Here the question is, is it possible to make this key start not with the number one, but, for example, with the number 5?

What type of id column do you have? If the number is normal, then you can make the numbering yourself, if the autonomy is impossible. In the case of a regular number type number, you will have to program the next number yourself each time. Those. write a query, search for the maximum, then add one unit to the maximum and save it to the users table. In the case of an auto-numerator, you do not need to do anything, but then the auto-numerator will number itself, without you, starting from the number 1

alex2021-11-14 08:19:22

@AlexanderPetrov agree, I was wrong)

alex2021-11-14 10:06:21