Hello,
I have the following select insert into statement:
insert into student
select student_id, student_cd, student_name
from student
where student_id = '9999'
The two columns - student_id and student_cd are primary keys.
When I try to insert, it gives me a 'unique constraint violated' error. Can you please tell me how I can use the insert above and increment the student_cd value by 1 of the max(student_cd) each time to avoid the constraint issue? or to just add 1000 each time to the student_cd value?
Thanks in advance.
Cathy![[sunshine] [sunshine] [sunshine]](/data/assets/smilies/sunshine.gif)
I have the following select insert into statement:
insert into student
select student_id, student_cd, student_name
from student
where student_id = '9999'
The two columns - student_id and student_cd are primary keys.
When I try to insert, it gives me a 'unique constraint violated' error. Can you please tell me how I can use the insert above and increment the student_cd value by 1 of the max(student_cd) each time to avoid the constraint issue? or to just add 1000 each time to the student_cd value?
Thanks in advance.
Cathy
![[sunshine] [sunshine] [sunshine]](/data/assets/smilies/sunshine.gif)