I am trying to create a many-many relationship between the max(id) in table1 with all the ids in table2, using a lookup table called table1_table2.
Ultimately so that the rows in table1_table2 will be:
table1_id, table2_id
30, 1
30, 2
30, 3
...
30, 10000
How can I do this?
I have tried
insert into insert into table1_table2 (table1_id, table2_id)
values (select max(id) from table2, select id from table3);
and
insert into insert into table1_table2 (table1_id, table2_id)
select max(table1_id), table2_id from table1
join table1_table2 on table1_table2.table1_id = table1.id
outer join table1_table2 on table1_table2.table2_id = table2.id;
But neither seem to work