I need to find matchs between two tables, but also need to display when there is no match.
Table1: id, dni_number, name, business_id
Table2: id, dni, business_id
I need to form a table like this:
id | dni | name | business_id | is_match |
---|---|---|---|---|
1 | 12365478 | John Doe | 15451 | 1 |
1 | 22365478 | Karen Doe | 23451 | 0 |
is_match meaning 1: it found the dni in table1 and also in table2, 0 for not match
The query should have a where condition to find matchs from certain business_id
Any help will be much appreciated. Thanks in advance
2
Answers