0

Example consider two tables Persons and Employee

Persons table sample:

Name,Address
1. john,new York
2. Diana,new jersey

Employee table sample:

Employee ID,Team
1. 123,developer
2. 568,tester

Required join Table output should be like

Name,Address,Employee ID,Team
 1.john,new York,null,null
 2.Diana,new jersey,null,null
 3.null.null,123,developer
 4.null,null,568,tester

I want above sample as output is there any way to solve this issue.

  • 4
    You may want to explain the logic behind the expected output, because it's not very clear. Please take a look at this advice – mustaccio Mar 1 '19 at 14:08
1

This can work for you:

SELECT *
FROM Persons a
LEFT JOIN Employee b ON 1=2
UNION
SELECT *
FROM Persons a
RIGHT JOIN Employee b ON 1=2;
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.