select cp.comp_cn,cp.comp_address,cp.comp_tel,oper.name_cn,dd.tihuo_man from diaodu dd join company cp on dd.comp_id=cp.comp_id join agent_staff ast on cp.comp_id=ast.comp_id join operator oper on ast.oper_id=oper.oper_id
调试欢乐多
from diaodu d left join company c on c.comp_id = d.comp_id
left join agent_staff a on a.comp_id = d.comp_id and a.re = '市场负责人'
left join operator o on o.oper_id = a.oper_id
create view xxxxxxxxxxx
as
select xXXX
from diaodu a left join company b
on a.comp_id=b.comp_id
left join agent_staff c
on b.comp_id=c.comp_id
left join operator d
on d.oper_id=c.oper_id