SQL connection error ... what is it called?

I have two tables that are combined. I have included the "exit" of the joined tables. I am wondering what is called this connection problem? There are duplicate lines.

Table 1       Table 2
ID Name Identification Name
1 4 & Marys
2 5 & Xavier 3 6 Gary

Connection Output:

Identifier Identification name
4 Mary 1 Joey
4 2 Shawn
4 Mary 3 Mark
5 & ​​nbsp; Xavier 1 Joey
5 & ​​nbsp; Xavier 2 Shawn
5 & ​​nbsp; Xavier 3 Mark
6 Gary 1 Joey
6 2 Shawn
6 3 Mark

+3
source share
4 answers

If memory is used, which is called the Cartesian product.

+8
source

I think your problem is what you want to use UNION, not JOIN.

Example:

SELECT * FROM Table1 UNION SELECT * FROM Table2;

Must give you:

ID  Name
1   Joey
2   Shawn
3   Mark
4   Mary
5   Xavier
6   Gary

Is this what you are trying to do?

+3
source
+1

SELECT * FROM Table2, Table1

CROSS JOIN, , 2 .

Sounds like you need a UNION

SELECT * FROM Table1
UNION
SELECT * FROM Table2
0
source

Source: https://habr.com/ru/post/1717966/


All Articles