autoincrementing a column
suppose there are two tables
Schools(school_id primary key with autocrement)
Students(school_id and student_id both primary key)student_id(autoincrementing)
Generally , I found
schools
school_id school_name ...
1 a
2 b
students
school_id student_id ...
1 1
1 2
2 3
3 4
but i want
(using auto-incrementing starting from beginning for different
school_id, but incrementing auto for same id)
school_id student_id
1 1
1 2
2 1
3 1
|