select a.code 编码,
a.name 名称,
e.name ||
(select name from bd_region where c.province = pk_region) ||
(select name from bd_region where c.city = pk_region) ||
(select name from bd_region where c.vsection = pk_region) ||
c.detailinfo 企业地址,
k.code 组织编码,
k.name 组织名称,
h.name 业务员
from bd_customer a
left join bd_defdoc b
on a.def18 = b.pk_defdoc
left join bd_address c
on a.corpaddress = c.pk_address
left join bd_countryzone e
on c.country = e.pk_country
left join so_custservtype_h g
on a.pk_customer = g.PK_COSTMER
left join bd_psndoc h
on g.salesman = h.pk_psndoc
left join org_orgs k
on g.PK_ORG = k.pk_org
where a.dr = 0
and a.enablestate = '2'
and g.state = '2'
and g.dr = 0
and g.vdef1 = '1'
评论前必须登录!
注册