1. Connect two tables query select * from TABLE1,TABLE2//2. Connecting two table queries select * FROM table1 join table2 on Table1.id=table2.id
1. The result of the first connection query is a Cartesian product: That is, the row count of table 1 multiplied by the number of rows in table 2 (each record in table one will be combined with each record in table two)
Such as:
Table One Table II
1 A
2 b
3 C
The result after the build is: 3x3 Strip records
1 A
1 b
1 c
2 A
2 b
2 C
3 A
3 b
3 C
2. The result of the second connection query is a record that conforms to table1.id=table2.d_id, and the statement after on is equivalent to a filter condition.
Table 2
ID e_name d_id D_name
1 a 1 Z
1 B 2 x
2 C
3d
The resulting query result is a record with an ID equal to d_id
ID e_name d_id D_name
1 a 1 Z
1 B 1 Z
2 C 2 x
SQL Server non-join statement differs from with join statement