在oracle pl-sql中,左连接和右连接以如下方式来实现
查看如下语句:
select emp_name, dept_name
form employee, department
where employee.emp_deptid(+) = department.deptid此sql文使用了右连接,即“(+)”所在位置的另一侧为连接的方向,右连接说明等号右侧的所有记录均会被显示,无论其在左侧是否得到匹配,也就是说上例中无论会不会出现某个部门没有一个员工的情况,这个部门的名字都会在查询结果中出现。
反之:
select emp_name, dept_name
form employee, department
where employee.emp_deptid = department.deptid(+)则是左连接,无论这个员工有没有一个能在department表中得到匹配的部门号,这个员工的记录都会被显示 。
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器