多表查询:从多张表中查询数据

内连接:相当于查询A、B两张表的交集

隐式连接:select t1.name,t1.id,t2.dname from epm t1,dept t2 where epm.name=dept.id

外连接:左外连接是查找A表所有数据和AB表的交集

select * from t1 join t2 on t1.id=t2.id

左外连接是查找B表所有数据和AB表的交集

select * from t1 left join t2 on t1.id=t2.id 查询t1的全部数据和t1t2的交集部分

子查询

 

posted on 2023-10-28 11:13  na2co3-  阅读(95)  评论(0)    收藏  举报