I have two tables that are joined. I've included the 'output' of the joined tables. I'm wondering what is this join problem called? There are duplicating rows.
Table 1 Table 2
ID Name ID Name
1 Joey 4 Mary
2 Shawn 5 Xavier
3 Mark 6 Gary
The join output is:
ID Name ID Name
4 Mary 1 Joey
4 Mary 2 Shawn
4 Mary 3 Mark
5 Xavier 1 Joey
5 Xavier 2 Shawn
5 Xavier 3 Mark
6 Gary 1 Joey
6 Gary 2 Shawn
6 Gary 3 Mark
If memory serves, that's called a Cartesian Product.
I think your problem is that you want to use UNION, not JOIN.
Example:
SELECT * FROM Table1 UNION SELECT * FROM Table2;
Should give you:
ID Name
1 Joey
2 Shawn
3 Mark
4 Mary
5 Xavier
6 Gary
Is this what you're trying to do?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With