/*取客户信息SQL*/
--客户信息
SELECT hou.name 业务实体,
hca.account_number 客户编号,
hp.party_name 客户名称,
arp_addr_pkg.format_address(hl.address_style,
hl.address1,
hl.address2,
hl.address3,
hl.address4,
hl.city,
hl.county,
hl.state,
hl.province,
hl.postal_code,
ftv.territory_short_name) 地址,
flv.meaning 用途,
gcc_rec.concatenated_segments 应收帐户,
gcc_rev.concatenated_segments 收入帐户
FROM hz_parties hp,
hz_party_sites hps,
hz_locations hl,
hz_cust_accounts hca,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcs,
fnd_lookup_values flv,
fnd_territories_vl ftv,
gl_code_combinations_kfv gcc_rev,
gl_code_combinations_kfv gcc_rec,
hr_operating_units hou
WHERE hp.party_id = hca.party_id
AND hp.party_id = hps.party_id
AND hps.location_id = hl.location_id
AND hca.cust_account_id = hcas.cust_account_id
AND hps.party_site_id = hcas.party_site_id
AND hl.country = ftv.territory_code(+)
AND hcas.cust_acct_site_id = hcs.cust_acct_site_id
AND flv.lookup_code = hcs.site_use_code
AND hcs.gl_id_rec = gcc_rec.code_combination_id(+)
AND hcs.gl_id_rev = gcc_rev.code_combination_id(+)
AND hou.organization_id = hcas.org_id
AND hca.status = 'A'
AND hps.status = 'A'
AND hcs.status = 'A'
AND flv.lookup_type = 'SITE_USE_CODE'
AND flv.lookup_code = 'BILL_TO'
AND flv.language = 'ZHS'
AND hou.organization_id = 81 --p_org_id
AND hca.cust_account_id = 1041 --p_customer_id
ORDER BY 1, 2;

最新文章

  1. Winform混合式开发框架访问Web API接口的处理
  2. CSS中单位px和em,rem的区别
  3. c# 复习
  4. 把 表拷贝到test测试数据库
  5. winform中利用反射实现泛型数据访问对象基类(1)
  6. Java中构造函数执行顺序的问题
  7. css3响应式布局
  8. C++之------构造函数
  9. android文件缓存,并SD卡创建目录未能解决和bitmap内存溢出解决
  10. ipv4属性无法打开
  11. 参考:Python 调试方法
  12. linux_磁盘体系
  13. 今天写代码遇到了一个BUG
  14. SQL Server进阶(十)事务和并发处理
  15. Introducing the Microservices Reference Architecture from NGINX
  16. 3.10 C++虚基类 虚继承
  17. DFS服务待书写
  18. android 解决输入法键盘遮盖布局问题
  19. Android 列表使用(ListView GridView Gallery图片计时滚动)
  20. Chino 操作系统开发日志 (1) - 为 IoT 而生

热门文章

  1. codevs 1006 等差数列
  2. [JLOI2015]城池攻占
  3. 【PowerOJ1738】最小路径覆盖
  4. 网络编程基础API
  5. WiFi认证中HTTPS重定向
  6. python MySQLdb pymsql
  7. C# 解决winform 窗体控件在窗体变化时闪烁的问题
  8. SpringMVC中url-pattern /和/*的区别
  9. json转化为对象数组
  10. 读书笔记-《Maven实战》-2018/4/17