I am trying to insert records into a mastertable. The first field is auto-incrementing and therefore I am unable to insert all records at the same time. I have create the following code to insert one record in at a time.
insert into `mastertable3`
select ' ', 0301_2500.ssn, 0301_2500.vsssn, 0301_2500.name_ind, 0301_2500.pay_gr_aa
from time_period, Mastertable3 right join 0301_2500 on mastertable3.ssn = 0301_2500.SSN
where (((if(mastertable3.ssn=0301_2500.ssn, 0, 1))=1))
limit 1
I am trying to create a loop to have this repeat continuously until the table 0301_2500 is exhausted, then switch to table 0302_2500, and etc...
Any ideas?