There is a table as follow:
Id || ParentId || Other Columns ...
=======================================
1 || 1 || ...
2 || 1 || ...
3 || 1 || ...
1 || 2 || ...
2 || 2 || ...
3 || 2 || ...
1 || 3 || ...
2 || 3 || ...
Column [Id] must have autoincremented value based on [ParentId] (own numeration).
What is the best way to achieve this goal?
try this
edit1:
If you want the id to be used in the where clause