时间:2021-07-01 10:21:17 帮助过:3人阅读
select * from tbl_dept a inner join tbl_emp b on a.id=b.deptId;
select * from tbl_dept a left join tbl_emp b on a.id=b.deptId;
select * from tbl_dept a right join tbl_emp b on a.id=b.deptId;
elect * from tbl_dept a left join tbl_emp b on a.id=b.deptId where b.deptId is null;
select * from tbl_dept a right join tbl_emp b on a.id=b.deptId where a.id is null;
select * from tbl_dept a right join tbl_emp b on a.id=b.deptId
union
select * from tbl_dept a left join tbl_emp b on a.id=b.deptId;
select * from tbl_dept a right join tbl_emp b on a.id=b.deptId where a.id is null union select * from tbl_dept a left join tbl_emp b on a.id=b.deptId where b.deptId is null;
MYSQL 的七种join
标签:fun insert clist block str top 执行 左连接 查询