select /*+ USE_HASH(T, W) */ w.hospital_name,
from (select /*+ USE_HASH(D1, E, C1) */ C1.hospital_id,
from mt_fee_fin D1,
bs_medi e,
mt_biz_fin C1,
bs_insured A1,
bs_corp_pres B1
where A1.indi_id = B1.indi_id + 0
AND A1.pers_type = :ln_pers_type
group by C1.hospital_id
union
select /*+ USE_HASH(A2, B2, C2) */ C2.hospital_id,
from bs_insured A2,
bs_corp_pres B2,
mt_biz_fin C2,
mt_pay_record_fin D2
where B2.indi_id = A2.indi_id
AND A2.pers_type = :ln_pers_type
group by C2.hospital_id) t,
bs_hospital w
where w.hospital_id = t.hospital_id
group by w.hospital_name在上述语句中,如何选择像w.hospital_name列一样选出 pers_type 列
谢谢
from (select /*+ USE_HASH(D1, E, C1) */ C1.hospital_id,
from mt_fee_fin D1,
bs_medi e,
mt_biz_fin C1,
bs_insured A1,
bs_corp_pres B1
where A1.indi_id = B1.indi_id + 0
AND A1.pers_type = :ln_pers_type
group by C1.hospital_id
union
select /*+ USE_HASH(A2, B2, C2) */ C2.hospital_id,
from bs_insured A2,
bs_corp_pres B2,
mt_biz_fin C2,
mt_pay_record_fin D2
where B2.indi_id = A2.indi_id
AND A2.pers_type = :ln_pers_type
group by C2.hospital_id) t,
bs_hospital w
where w.hospital_id = t.hospital_id
group by w.hospital_name在上述语句中,如何选择像w.hospital_name列一样选出 pers_type 列
谢谢
解决方案 »
- 用shell命令查程序运行时间
- 求购Oracle数据库系统建一数据中心,需要硬件工程师提供硬件解决方案,非诚勿扰
- 请教一下:如果将系统时间精确到毫秒,谢谢!
- [ORA-00932]错误, MSADO开发时在TimeStamp使用中的问题
- toad创建的数据库默认用户名,密码是什么?
- 请问如何将某用户的所有表一次性删除
- 我怎么连接到服务器的啊
- 在程序中调用存储过程时出现引用超出范围是什么意思?怎么解决?
- 项目作完了,打包安装有问题,开发工具用的是PB,数据库为oracle 9i ,是通过odbc "oracle in oraclehome90"访问的,但是用install shield作安
- oracle数据库迁移后遇到的问题
- 求救!!PL/SQL的问题 我都快郁闷死了 在线等
- PL/SQL的问题 在线等 救命啊!!
from (select /*+ USE_HASH(D1, E, C1) */ C1.hospital_id, 0 as pers_type
from mt_fee_fin D1,
bs_medi e,
mt_biz_fin C1,
bs_insured A1,
bs_corp_pres B1
where A1.indi_id = B1.indi_id + 0
AND A1.pers_type = :ln_pers_type
group by C1.hospital_id
union
select /*+ USE_HASH(A2, B2, C2) */ C2.hospital_id, A2.pers_type as pers_type
from bs_insured A2,
bs_corp_pres B2,
mt_biz_fin C2,
mt_pay_record_fin D2
where B2.indi_id = A2.indi_id
AND A2.pers_type = :ln_pers_type
group by C2.hospital_id) t,
bs_hospital w
where w.hospital_id = t.hospital_id
group by w.hospital_name
from (select C1.hospital_id,min(a1.pers_type) as pers_type
from mt_fee_fin D1,
bs_medi e,
mt_biz_fin C1,
bs_insured A1,
bs_corp_pres B1
where A1.indi_id = B1.indi_id + 0
AND A1.pers_type = :ln_pers_type
group by C1.hospital_id
union
select C2.hospital_id, min(a2.pers_type) as pers_type
from bs_insured A2,
bs_corp_pres B2,
mt_biz_fin C2,
mt_pay_record_fin D2
where B2.indi_id = A2.indi_id
AND A2.pers_type = :ln_pers_type
group by C2.hospital_id) t,
bs_hospital w
where w.hospital_id = t.hospital_id
group by w.hospital_name