left JOIN menu m
on (r.rid = m.fid)
使用union 去重固然好 但是查询效率低 union all 查询效率高
三表查询id name员工姓名 target员工工资 sname 员工部门 rid员工工资等级
select m.id,m.name,m.target,s.sname,r.rid
FROM menu m
join section s
on (m.fid=s.sid)
join role r
on(m.name between r.zuidi and r.zuigao)
四表查询
select m.id,m.name,m.target,s.sname,r.rid,t.*
FROM menu m
join section s
on (m.fid=s.sid)
join role r
on(m.name between r.zuidi and r.zuigao)