【正文】
SS JOIN clause produces the crossproduct of two tables. ? This is the same as a Cartesian product between the two tables. SELECT last_name, department_name FROM employees CROSS JOIN departments 。 || FROM employees worker, employees manager WHERE = 。 使用外連接 … 自連接 EMPLOYEES (WORKER) EMPLOYEES (MANAGER) MANAGER_ID in the WORKER table is equal to EMPLOYEE_ID in the MANAGER table. … … 自連接 SELECT || 39。 SELECT , FROM table1, table2 WHERE = (+)。 … 非等值連接 EMPLOYEES JOB_GRADES Salary in the EMPLOYEES table must be between lowest salary and highest salary in the JOB_GRADES table. … 使用非等值連接檢索記錄 SELECT , , FROM employees e, job_grades j WHERE BETWEEN AND 。 使用表別名 ? 使用表別名實(shí)現(xiàn)簡(jiǎn)化查詢(xún) . ? 使用表別名作為前綴可以提高查詢(xún)性能 . 連接兩張以上的表 EMPLOYEES LOCATIONS DEPARTMENTS ? 連接 n張表,需要 n1個(gè)條件。 使用等值連接檢索數(shù)據(jù) … 使用 AND增加附加的連接條件 EMPLOYEES DEPARTMENTS … … 消除含混不清的列名 ? 在多張表查詢(xún)中使用表別名限定列可以消除列名含混不清的情況。Oracle開(kāi)發(fā) 第五節(jié)課 多表查詢(xún) 課程目標(biāo)