数据表的连接有:
1.内连接(自然连接):只有两个表相匹配的行才能在结果集中出现。
select a.studentno,a.studentname,b.classname
from student a,classes b
where a.classid = b.classid;
2.外连接,包括:
(1)左连接:左连接显示左边全部的和与左边相同的;
select a.studentno,a.studentname,b.classname
from student a,classes b
where a.classid = b.classid(+);
(2)右连接:右连接显示右边全部的和与右边相同的;
select a.studentno,a.studentname,b.classname
from student a,classes b
where a.classid(+) = b.classid;
(3)全连接:全连接显示左边全部的和右边全部的;
3.自连接:连接发生在一张基表内。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22012035/viewspace-694252/
,如需转载,请注明出处,否则将追究法律责任。