All
I have two tables=
Master table
id_master, int, Autoincremental
detail_table
id_master
id_detail,int Autoincremental
My question is, in the detail table, how create a table that the id_detail start in 1, when a id_master is new?
Example
Master_table
id_master
1
2
3
detail_table
id_master id_detail
1 1
1 2
1 3
2 1
2 2
3 1
How do I do it every time a new id is added in the "master" start of 1 in the "detail"?