Is it possible to have a column say ORDER in a table to autoincrement only when inserting a new ID? So say I have the following column:
ID ORDER
1 0
1 1
1 2
1 3
1 4
When I insert another ID order increments to 5, when I insert 2 as a new ID order starts from 0.
This example uses a composite index but numbering starts from 1
If you want that it starts from zero you need a trigger as already said.