-
SQL语言基础中的笛卡尔积
资源介绍
笛卡尔积
*
以笛卡尔积连接的表具有下列特征:
连接条件被忽略。
第一个表中的所有的行与第二个表中的所有行相连接。
如果在WHERE子句中加入条件,那么可以避免笛卡尔积.
*
Cartesian Product
When a join condition is invalid or omitted completely, the result is a Cartesian product in which all combinations of rows will be displayed. All rows in the first table are joined to all rows in the second table.
A Cartesian product tends to generate a large number of rows, and its result is rarely useful. You should always include a valid join condition in a WHERE clause, unless you have a specific need to combine all rows from all tables.
Instructor Note
Cartesian product is useful for some tests when you need to generate a large number of rows to simulate a reasonable amount of data.