|
|

楼主 |
发表于 2006/9/12 00:32:15
|
显示全部楼层
AR客户联系人的SQL
- begin
- fnd_client_info.set_org_context(90);
- end;
-
- select a.customer_id,
- d.address_id,
- a.customer_number 客户编号,
- a.customer_name 客户名称,
- a.attribute1 与公司关系,
- a.attribute2 渠道,
- a.attribute3 行业,
- b.description 一级行业分类,
- c.description 二级行业分类,
- d.status 状态,
- d.country 国家,
- d.address1 地址,
- d.address2 地址2,
- d.address3 地址3,
- d.address4 地址4,
- e.last_name 联系人,
- f.phone_type 联系方式,
- f.area_code 地区代码,
- f.phone_number 电话号码
- from apps.ra_customers a,
- (select t.FLEX_VALUE, t.DESCRIPTION
- from apps.FND_FLEX_VALUES_VL t
- where t.FLEX_VALUE_SET_ID = 1009676) b,
- (select t.FLEX_VALUE, t.DESCRIPTION
- from apps.FND_FLEX_VALUES_VL t
- where t.FLEX_VALUE_SET_ID = 1009735) c,
- apps.AR_ADDRESSES_V d,
- apps.ar_contacts_v e,
- apps.ra_PHONES f
- where a.customer_number like 'AD_%'
- and b.flex_value(+) = a.attribute4
- and c.flex_value(+) = a.attribute5
- and d.customer_id = a.customer_id
- and e.address_id = d.address_id
- and e.contact_id = f.contact_id
-
-
复制代码 |
|