Negative indexes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Negative indexes

Why do indexes in the database start at -1?

21st Jul 2020, 9:35 AM
Mary_d9
Mary_d9 - avatar
8 Answers
0
Mary_d9 What index did you mean?
21st Jul 2020, 11:08 AM
Ipang
0
Ipang id in a table
21st Jul 2020, 2:22 PM
Mary_d9
Mary_d9 - avatar
0
Mary_d9 You mean identity column a.k.a auto increment column? I'm afraid I'm still not getting what you mean here ...
21st Jul 2020, 5:30 PM
Ipang
0
Ipang yes, i'm about it
21st Jul 2020, 5:34 PM
Mary_d9
Mary_d9 - avatar
0
Mary_d9 As per my understanding, an identity column be adjustable in terms of initial value and incremental step. But I don't see how it makes sense when an identity column should be setup to be initialized by -1 ... Or maybe some things had changed since last time I read about it ...
21st Jul 2020, 5:41 PM
Ipang
0
Ipang I made it start from 1, but for some reason it starts with - 1, then - 2. However, I save the table and it becomes 1, 2. Its strange.
21st Jul 2020, 5:47 PM
Mary_d9
Mary_d9 - avatar
0
Mary_d9 Yes, that is strange, in fact, this is first time I hear about such case. I'll try search for it, it's really strange behaviour ...
21st Jul 2020, 5:50 PM
Ipang
0
Mary_d9 Until now I still can't find any similar cases. I look forward for others opinions ...
22nd Jul 2020, 3:48 AM
Ipang