Reputation: 1118
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
Upvotes: 3
Views: 182
Reputation: 23093
Based on your output, your query is something like
SELECT * FROM Table2, Table1
This is called a CROSS JOIN and this is the normal behavior that for each row in table2, the values from table1 will be appended.
What you seem to want is a UNION
SELECT * FROM Table1
UNION
SELECT * FROM Table2
Upvotes: 0