I have 2 tables like which I would like to query to form a new table.
table 1
number type serial index
1000001 613 3 1
1000001 613 3 1
1000001 613 3 1
1000001 613 3 1
1000001 613 4 1
1000001 613 3 1
table 2
number type serial index
1000001 613 3 2
1000001 613 3 3
1000001 613 3 4
1000001 613 3 4
1000001 613 4 2
1000001 613 3 1
I am looking for a query which gives a resultant of indexes and numbers like this, and adds the index, and gives the result:
output table
number index
1000001 3
1000001 4
1000001 5
1000001 5
1000001 3
1000001 2
I want to prevent cross joins here. I can't use where clause because the numbers are same in both tables only the index varies. How can I execute this one-to-one and not one-to-many.