select*from tbl_emp a innerjoin tbl_dept b on a.deptId=b.id;select*from tbl_emp a LEFTJOIN tbl_dept b on a.deptId=b.id;select*from tbl_emp a RIGHTJOIN tbl_dept b on a.deptId=b.id;select*from tbl_emp a LEFTJOIN tbl_dept b on a.deptId=b.id where b.id isnull;select*from tbl_emp a RIGHTJOIN tbl_dept b on a.deptId=b.id where a.id isnull;select*from tbl_emp a LEFTJOIN tbl_dept b on a.deptId=b.id unionselect*from tbl_emp a RIGHTJOIN tbl_dept b on a.deptId=b.id;select*from tbl_emp a LEFTJOIN tbl_dept b on a.deptId=b.id where b.id isnullunionselect*from tbl_emp a RIGHTJOIN tbl_dept b on a.deptId=b.id where a.id isnull;