exists (sql 返回结果集为真)
not exists (sql 不返回结果集为真)
已有两张表(t_a和 t_b):
左外连接
-
select * from t_a a left join t_b b on a.id=b.id;
-
select * from t_a a , t_b b where a.id=b.id(+);
右外连接
- select * from t_a a right join t_b b on a.id = b.id;
- select * from t_a a , t_b b where a.id(+)=b.id;
完全外连接
select * from t_a a full join t_b b on a.id=b.id;
等值连接
- select * from t_a a , t_b b where a.id=b.id;
- select * from t_a a join t_b b on a.id=b.id; --等值连接也可以这样写