名站网址导航为大家提供关于数据库教程相关的教程网站知识。
1. LEFT OUTER JOIN:左外关联Excel VBA连接并操作办法Oracle
复制具体相关代码 具体相关代码如下:,Public Sub ConOra() On Error GoTo ErrMsg: Dim ConnDB As ADODB.Connection Set ConnDB = New ADODB.Conn
SELECT e.last_name, e.department_id, d.department_name
FROM employees e
LEFT OUTER JOIN departments d
ON (e.department_id = d.department_id);
等价于
SELECT e.last_name, e.department_id, d.department_name
FROM employees e, departments d
WhERE e.department_id=d.department_id( );
结果为:所有员工及对应部门的记录,包括没有对应部门编号department_id的员工记录。
2. RIGhT OUTER JOIN:右外关联
SELECT e.last_name, e.department_id, d.department_name
FROM employees e
RIGhT OUTER JOIN departments d
ON (e.department_id = d.department_id);
等价于
SELECT e.last_name, e.department_id, d.department_name
FROM employees e, departments d
WhERE e.department_id( )=d.department_id;
结果为:所有员工及对应部门的记录,包括没有任何员工的部门记录。
3. FULL OUTER JOIN:全外关联
SELECT e.last_name, e.department_id, d.department_name
FROM employees e
FULL OUTER JOIN departments d
ON (e.department_id = d.department_id);
结果为:所有员工及对应部门的记录,包括没有对应部门编号department_id的员工记录和没有任何员工的部门记录。 关于数据库教程相关的教程网站知识今天我们就说到这里了,希望可以帮到大家。