tall表:

tcount表:

一、内连接
读取tall表中所有runoob_author字段在tcount_表对应的runoob_count字段值:
select a.runoob_id,a.runoob_author,b.runoob_count from tall a join tcount b on a.runoob_author=b.runoob_author;
或者
select a.runoob_id,a.runoob_author,b.runoob_count from tall a , tcount b where a.runoob_author=b.runoob_author;

INNER JOIN等价于WHERE 子句
二、左连接 left join (读取左边数据表的全部数据,即便右边表无对应数据)

三、右连接 right join(会读取右边数据表的全部数据,即便左边边表无对应数据)


被折叠的 条评论
为什么被折叠?



