I have 2 tables like which i would like to query to form a new table.
i am looking for a query which gives a resultant of indexes and number like this and adds teh index and give s the result
I want to prevent cross join here i cant 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
Code:
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
Code:
output table
number index
1000001 3
1000001 4
1000001 5
1000001 5
1000001 3
1000001 2
Comment