多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
三张表,需要得到的数据是标红色部分的。sql如下: select a.uid,a.uname,a.upsw,a.urealname,a.utel,a.uremark, b.rid,b.rname,b.rremark,c.deptid,c.deptname,c.deptremark from table1 a,table2 b,table3 c where a.sems\_role\_rid=b.rid and a.udeptid=c.deptid  或者: select a.uid,a.uname,a.upsw,a.urealname,a.utel,a.uremark, b.rid,b.rname,b.rremark,c.deptid,c.deptname,c.deptremark from table1 a left join table2 b on  a.sems\_role\_rid=b.rid left join table3 c on a.udeptid=c.deptid  LEFT JOIN 可以实现统一数据库多表联合查询符合条件的数据。