1.子查询:
select * from a,b,c,d where a.id =b.id and a.uid = c.uid and a.no = d.no;不推荐用*,而是用比如a.id,a.uid,a.no,a.text等写清楚每个要查询字段.子查询灵活,但效率不如连接查询.2.连接查询
select * from a join b on a.id=b.id join c on a.uid = c.uid join d on a.no = d.no;不推荐用*,而是用比如a.id,a.uid,a.no,a.text等写清楚每个要查询字段.把主表写在前,数据量大的表写在前(提升效率).连接查询分外连接 lef...
|