I have two tables that are indirectly related by another table
TableA - ID, SomeFieldA
TableB - ID, SomeFieldB
TableAB - IDA, IDB, SomeFieldAB
I have to generate data from the ground up. So I've put some data in TableA, and I've put some data in TableB. The problem is, I need to insert data into TableAB now, and I don't know how to generate a script that will do all the permutations of TableA and TableB together.
For instance:
Table A has two records:
1, 'A'
2, 'AA'
Table B has two records:
3, 'B'
4, 'B'
I want to insert the following data into TableAB:
1, 3, 'first perm'
1, 4, 'second perm'
2, 3, 'third perm'
2, 4, 'fourth perm'
What's the easiest way to do this?