Dear experts
Say I have two following tables:
Table1:
ID | Item1
1 | Table
2 | Chair
3 | Shelf
Table2:
ID | Item2
2 | Book
3 | Paper
4 | Pen
I need to create query which looks like this:
ID | Item1 | Item2
1 | Table | Null
2 | Chair | Book
3 | Shelf | Paper
4 | Null | Pen
I am managing it by creating first query UNION on ID, second query group by ID (to get each number only once) and third query with query2, table1 and table2 (including all records from query2).
Nevertheless I suspect that there is easier (less queries involved) way to achieve the same.
Thank you in advance for ideas.
PS. ID in both tables are unique.
Say I have two following tables:
Table1:
ID | Item1
1 | Table
2 | Chair
3 | Shelf
Table2:
ID | Item2
2 | Book
3 | Paper
4 | Pen
I need to create query which looks like this:
ID | Item1 | Item2
1 | Table | Null
2 | Chair | Book
3 | Shelf | Paper
4 | Null | Pen
I am managing it by creating first query UNION on ID, second query group by ID (to get each number only once) and third query with query2, table1 and table2 (including all records from query2).
Nevertheless I suspect that there is easier (less queries involved) way to achieve the same.
Thank you in advance for ideas.
PS. ID in both tables are unique.