文件名称:笛卡尔乘积-复杂查询技术-连接
文件大小:671KB
文件格式:PPT
更新时间:2024-05-15 15:58:09
sql
笛卡尔乘积 笛卡尔乘积的形成,当: 一个连接条件被遗漏时 一个连接条件不正确时 第一个表的所有行被连接到第二个表的所有行时 为了避免笛卡尔乘积的形成,在WHERE 子句中应当总是包含正确的连接条件 * Cartesian Products When a join condition is invalid or omitted completely, the result is a Cartesian product, in which all combinations of rows are 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 the 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. Cartesian products are useful for some tests when you need to generate a large number of rows to simulate a reasonable amount of data.