I currently have 2 tables which needs to be joined.
The first table is a big table,millions of records. The second is a matching table. I would want to join the 2 table. A table of the intended result is shown below. I would need tips on how to write the SQL to join the 2 tables.
Table 1
ID X Column X
1 X1
2 X2
3 X3
4 X4
5 X5
6 X6
... ...
the list goes on
Table 2
ID Column Y
1 Y1
3 Y2
6 Y3
11 Y4
Intended result
ID X Column X Column Y
1 X1 Y1
2 X2 Y1
3 X3 Y2
4 X4 Y2
5 X5 Y2
6 X6 Y3
7 X7 Y3
8 X8 Y3
9 X9 Y3
10 X10 Y3
11 X11 Y4
12 X12 Y4