I have a table
id int
sub_id int
name varchar
Example:
id, sub_id, name
1, 1, USA
1, 2, Germany
1, 3, Russia
2, 1, English
2, 2, German
2, 3, Russian
Let's say user enter 3 for id, so sub_id
should be 1, 2, 3... if user will enter 4, sub_id
count should start from 1. Is it possible to autoincrement sub_id
?