TCA客户地址查询

来源:互联网 发布:新加坡国立大学知乎 编辑:程序博客网 时间:2024/04/29 04:30
SELECT hp.party_name,
       hps.party_site_name      站点名称,
       hpsu.site_use_type,
       hl.address1              地址1,
       hl.city                  市,
       hl.postal_code           邮编,
       hl.province              省,
       hl.county                县,
       ter.territory_short_name 国家
  FROM hz_parties         hp,
       hz_party_sites     hps,
       hz_party_site_uses hpsu,
       hz_locations       hl,
       fnd_territories_vl ter
 WHERE /* hpsu.party_site_id = hps.party_site_id*/--连接位置及其作用
       /* AND hp.status = 'A'*/ --客户状态为活动  
       /*AND hpsu.status = 'A'*/ --位置作用状态为活动
       /*AND hp.party_id = hps.party_id*/--连接客户和中间关系
       /*AND hps.location_id = hl.location_id*/--连接中间关系和位置
       /*AND ter.territory_code = hl.country*/--连接国家详细信息  

原创粉丝点击