嵌入的左连接。
也就是像这样:select U.*,count(l.userid) from (select t.userid,t.username ,d.deptname from user t left outer join dept d on t.deptid = d.deptid group by t.userid,t.username) U left outer join log l on U.userid=l.userid select * from table1 t1,table2 t2 where t1.id=t2.id
这样就是联合查询啊
left join
right join
inner join
详细的看 *** 作手册啊
评论列表(0条)