首页 > 数据库 > Oracle > About join~!
left join
right join
self join
P.S http://www.cnblogs.com/eflylab/archive/2007/06/25/794278.html
[@more@]左连接:将左表中的所有数据分别与右表中的每条记录进行连接组合,返回的结果除了内连接的数据外,还有左表中不符合条件的数据,并在右表的相应列中填上NULL值;
自连接: create table t_emp(
emp_id number ,
emp_name varchar2(10)
)
如果想查询名字相同的人的员工的id,
select t1.emp_id from t_emp t1,t_emp t2 where t1.emp_name=t2.emp_name and t1.emp_id<>t2.emp_id
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10484922/viewspace-975047/ ,如需转载,请注明出处,否则将追究法律责任。