首页 / ORACLE / oracle 视图多表关联查询,
oracle 视图多表关联查询,
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle 视图多表关联查询,,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1268字,纯文字阅读大概需要2分钟。
内容图文
![oracle 视图多表关联查询,](/upload/InfoBanner/zyjiaocheng/456/2a7f9c25dfbe4da497b0ecc29ada17bb.jpg)
select distinct
t.id,
p.palias,
cname,
c.currency_unit,
t.company_name isp, --运营商名称
t.code buessies, --下游客户名称
t.country_code, --国家码
t.price, --价格
t.country, --查出国家
‘1‘ gamecode,
to_char(t.receive_time,‘yyyymmdd‘) cdate,
to_char(t.receive_time,‘yyyymm‘) cmonth,
to_char(t.receive_time,‘yyyy‘) cyear,
to_char(t.receive_time,‘yyyy-mm-dd hh24:mi:ss‘) insertdate,
trunc(pt.one_income,3) priceRMB,--单条RMB收入 无附加坏帐率
s.bshark_local_income priceLocal, --黑鲨当地货币收入 已附加坏帐率
s.bshark_local_income * c.exchange_rate priceBshark, --黑鲨单条收入 当地货币*汇率
pt.partner_one_income pricePartner, --合作伙伴单条收入(RMB)
s.price totalPrice, --资费
trunc((c.exchange_rate*s.price),3) totalRMBPrice, --RMB资费
s.sp_name sp_name
from bs_dcb_message t,qgc_countrysp s ,qgc_country c,qgc_partner p,bs_price_table pt
where
lower(t.code)=lower(p.pname)
and lower(t.country_code)=lower(c.country_code)
and lower(s.isp)=lower(t.company_name)
and p.pname=t.code
and s.country_id = c.id --SP:通过SP的国家ID再次锁定SP
and pt.sp_id = s.id --通过SP找到对应的价格表
and pt.partner_id = p.id --合作伙伴:通过合作伙伴ID锁定合作伙伴的价格表
oracle 视图多表关联查询,
标签:
本文系统来源:http://www.cnblogs.com/jessi/p/4742902.html
内容总结
以上是互联网集市为您收集整理的oracle 视图多表关联查询,全部内容,希望文章能够帮你解决oracle 视图多表关联查询,所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。