I have two tables in a MySQL database.
Table1
a_id
1
3
4
5
6
Table2
b_id
1
2
3
I would like to spot the missing row from Table1 a_id 2, and missing rows from Table2 b_id 4,5,6, which should be shown in columns deleted_from_a, deleted_from_b with values 1.
Expected output:
+----+----+--------------+--------------+
|a_id|b_id|deleted_from_a|deleted_from_b|
| 1| 1| 0| 0|
| | 2| 1| 0|
| 3| 3| 0| 0|
| 4| | 0| 1|
| 5| | 0| 1|
| 6| | 0| 1|
+----+----+--------------+--------------+
How can I query the output result?
EDIT1:
Updated Table1, to have additional values compared to Table2.
EDIT2:
Updated the specification, it was not perfect at the beginning.