これがあなたが望むもののように聞こえます:
INSERT INTO table1_table2 (table1_id, table2_id)
SELECT MAX(table1.id), table2.id FROM table1, table2 GROUP BY table2.id;
これがあなたが望むもののように聞こえます:
INSERT INTO table1_table2 (table1_id, table2_id)
SELECT MAX(table1.id), table2.id FROM table1, table2 GROUP BY table2.id;