inner join(等值连接) 只返回两个表中联结字段相等的行
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录
right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录.../主要作用为: 让数据减少冗余
上例中的延续
select a.*, b.*, c.*, d.* from cttag as d left join ((ctarticle as a left join...=a.articleid;
显示文章表中的全部, 调用类别表中的栏目
select a.*, b.*, c.* from (ctarticle a left join ctclass b on a.classid...=b.classid) left join ctnclass c on a.nclassid=c.nclassid
//作用, 有时在文章表中包含了在个别类别表中没有的数据, 用这个语法可以读出文章表的全部数据...=b.classid where a.nclassid=20
查询别名 a,b 表, 只匹配 b 表中的内容.