I want to insert into table B
for a range of employees from table A
where the select
statement for the insert
is from table B
.
To restate that; I have created all the records I need in table B
for one employee (employeeid = 1). Now I want to insert
into table B
similar records for a range of employees in table A
.
so far I have
insert TABLEB as B
(EMPLOYEEID, COLUMN1, COLUMN2, COLUMN3)
SELECT A.EMPLOYEEID, B.COLUMN1, B.COLUMN2, B.COLUMN3
FROM TABLEB
WHERE EMPLOYEEID = 1
now I want that to insert for each row in Table A
that meets a selecion criteria
the above works for one employee. How do I make it iterate for a range of employees from table A
.
note that the EMPLOYEEID I want to insert for each row in table B
will be the ID from the employee in table A.
Thanks,