Let's say I have two tables
Table 1
COl_1 COl_2
1 5
2 6
3 7
4 8
AND Table 2
COL3 COL4
9 13
10 14
11 15
12 16
I want the following:
COL_1 COL_2 COL3 COL4
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
Also, the number of rows are exactly the same everytime in each of the tables, no key relation or integrity stuff.
Any clue?
You can do this using
row_number()
to add a "join" key to the two tables:If the tables have different numbers of rows, you might want an outer join.