现在的问题是,给你一组work_ord_no,要求找出同一svc_inst_id下,日期cust_request_dt比给出的work_ord_no的cust_request_dt早的其他的work_ord_no.select
...
from op_work_odr w1
where exists(
select 'X' fro mop_work_odr w2
where w2.svr_inst_id=w1.svr_inst_id
and w2.cust_request_date>w1.cust_request_date
and w2.work_odr_no in (.....)
)
...
from op_work_odr w1
where exists(
select 'X' fro mop_work_odr w2
where w2.svr_inst_id=w1.svr_inst_id
and w2.cust_request_date>w1.cust_request_date
and w2.work_odr_no in (.....)
)
解决方案 »
- oracle in 的问题
- plsql登录oracle问题
- 急急急急急急
- pl/sql 如何操作XML文件?谢谢
- sql 关于to_date日期格式问题求助
- Oracle 10g WIn7, OracleOraDb10g_home1TNSListener 启动时报错 1067 ??
- 哪位大哥大姐给点内存数据库方面的资料,或者建议啊!小弟急需。
- --------高手们看看我的trigger为什么编译总有问题?-----------
- 请问从sql server 2000把数据导入oracle 9i,哪些字段类型不能导??
- Oracle高手何在?关于多个字段取值为null时的重新赋值问题
- vc+ado+oledb+Oracle 为什么记录集无法更新?(100分,在线等.....)
- 涉及到两个表的触发器问题
from op_work_ord w1,op_svc_inst b
where exists
(select * from op_work_ord w2
where w2.svc_inst_id = w1.svc_inst_id
and w2.cust_req_dt > w1.cust_req_dt
and w2.work_ord_no in
('AGU8948001',
'AIN4900001',
'AMO9617002',
'AMO9706001',
'AKY7564002',
'AKZ0788001',
'ALA2267001',
'AKE9353001',
'AIM9927001',
'AGH5554001',
'AGW1777001',
'AKF9614001',
'AKG4685001',
'AKH2534001',
'AKD7778001',
'AGS3051001',
'ALP5110001',
'ALQ9661001',
'ALE3619001',
'AJQ2258001',
'AJQ3104001',
'AGT2800001',
'ALC9636001',
'ALD9578002',
'ALP7602011',
'ADU4963001',
'AEE1759001',
'AEL2828001',
'AES8569001',
'AFN8675001',
'AIS0249002',
'AHC2846001',
'AHC5856001',
'AFF0556001',
'AEL8677001',
'AGR5171001',
'AFT9010002',
'AKH8004001',
'AFL9544001',
'AGQ8005002',
'AFY3005001',
'AGU3678001',
'AGV0354001',
'AGD3244001',
'AGQ8217002',
'AGQ7221001',
'AKZ9664001',
'AIN4881001',
'AHB4837001',
'AHL3544001',
'AHX7958001',
'ALF7760001',
'ALF4733001',
'AIA4986001',
'AHU4034001',
'AHY9055001',
'AIM2381001',
'AHX8522001',
'AJG8702001',
'AIK5304001',
'AIG2499001',
'AIS3175001',
'AIS6034001',
'AIM9201001',
'AJA2960001',
'AIW5742002',
'AJF0617001',
'AKH2861001',
'AKI3615004',
'AKQ9654001',
'AKD6394001',
'AIW7796001',
'AKI6433001',
'AJV5060001',
'AKE7136001',
'AKY9723001',
'AKD7071001',
'AJX1077001',
'AKL6287001',
'ALD5734001',
'AKH0388001',
'AKS9546001',
'AKZ1822001',
'AKV4087001',
'ALD5807001',
'AKT6905001',
'AKU8313001',
'ALE1073001',
'ALH8090001',
'ALD9966001',
'ALE0335001',
'ALR3303001',
'ALR1116001',
'AKE0673001',
'AKH1172001',
'ALP5120001',
'AKD8358001',
'AKZ8113001',
'ALA0741001',
'AKS8237001',
'AIS7184001',
'AIW2778001',
'AKR9422001',
'AGZ2944001',
'AMF3390001',
'AJL6757001',
'AJM0828001',
'AJL3225001',
'AHQ9616001',
'ALF9733001',
'AHQ9212001',
'ALR3588001',
'ALR8560001',
'ALQ1446001',
'AIY2966001',
'AIY3181001',
'AKZ4722001',
'AEO1214001',
'AEQ9165001',
'AJW6713001',
'ALT2581001',
'ALH3083001',
'AJJ3917001',
'AEN9718001',
'AFM7421001',
'AGQ4899001',
'AIX3916001',
'AJS1401001',
'AKK1398001',
'AFP9529001',
'AKD8564001',
'ALP9046001',
'AGJ0650001',
'AGQ5465001',
'AIJ7781001',
'AKZ1530001',
'ALA3762001',
'AJF9666001',
'AJI4156001',
'AMO9464001',
'AMO9581001',
'AHN1271001',
'AJL3971001',
'ALP8964001',
'AGY3649001',
'AMO9540001',
'AMO9777002',
'AMO9732002',
'AHH5380001',
'AGS2340001',
'AET0174001',
'AEY6899001',
'AFE4615001',
'AMF3078001',
'AEL9132001',
'AFA0725001',
'AKP3633001',
'AHM0120001',
'AJZ5232001',
'AGK8066001',
'AIY8587002',
'AGP5134001',
'AJV6176001',
'AKP3324001',
'ALJ2915001',
'AKE3860001',
'AJU1086002',
'AHY9495001',
'AIY4614001',
'AKL8929001',
'ALH9206001',
'ALA2973001',
'AFA0515001',
'ALG7478001',
'AEY4276001',
'AEY4325001',
'AKU0261001',
'AJP3617001')
)
and w1.svc_inst_id=b.svc_inst_id
and w1.work_ord_status='1'
and b.svc_ty = 'TS'
--AND b.RENTAL_TARIFF_GRP='01'
--and b.SVC_TY='MT'?
AND (b.RENTAL_TARIFF_GRP='11' OR b.RENTAL_TARIFF_GRP='21')
...
from op_work_odr w1
where exists(
select 1 fro mop_work_odr w2
where w2.svr_inst_id=w1.svr_inst_id
and w2.cust_request_date>w1.cust_request_date
and w2.work_odr_no in ('AKL6287001',
'AJX1077001',
'AKL6287001',
'ALD5734001',
'AKH0388001',
'AKS9546001',
'AKZ1822001',
'AKV4087001',
'ALD5807001'
)
)