|
select service_num, subscription_id
from ucs_subscription
where customer_id in
(select customer_id
from ucs_subscription
where subscription_id = :1
and active_date < = to_date(:2, 'yyyymm')
and inactive_date > to_date(:3, 'yyyymm'))
and active_date <= to_date(:4, 'yyyymm')
and inactive_date > to_date(:5, 'yyyymm')
这SQL写的。。。
发下执行计划- explain plan for service_num, subscription_id
- from ucs_subscription
- where customer_id in
- (select customer_id
- from ucs_subscription
- where subscription_id = :1
- and active_date < = to_date(:2, 'yyyymm')
- and inactive_date > to_date(:3, 'yyyymm'))
- and active_date <= to_date(:4, 'yyyymm')
- and inactive_date > to_date(:5, 'yyyymm')
-
- select * from table(dbms_xplan.display());
复制代码 |
|