explain plan for
select *
from (select to_char(to_date(a.init_date, 'YYYYMMDD'), 'YYYY-MM-DD') || '@' ||
trim(case
when length(a.fund_account) > 10 then
to_char(a.fund_account)
else
lpad(a.fund_account, 10, '0')
end) || '@' || trim(a.futu_business_no) || '@' ||
trim(a.contract_code) || '@' ||
trim(to_char(case
when (a.entrust_bs = '1') then
'B'
else
'S'
end)) || '@' ||
trim(a.business_amount / a.amount_per_hand) || '@' ||
(case
when a.open_drop_price = 0 then
'0.00'
else
trim(to_char(a.open_drop_price,
'999999999999999999999999999990.99'))
end) || '@' || (case
when a.business_amount * a.open_drop_price = 0 then
'0.00'
else
trim(to_char(a.business_amount * a.open_drop_price,
'999999999999999999999999999990.99'))
end) || '@' || case
when length(to_char(a.business_time)) > '6' then
trim(to_char(to_date(left(to_char(a.business_time,
'00000000'),
6),
'HH24MISS'),
'HH24:MI:SS'))
else
trim(to_char(to_date(to_char(a.business_time, '000000'),
'HH24MISS'),
'HH24:MI:SS'))
end || '@' || trim(to_char(case
when (a.futures_direction = '1') then
'O'
else
'L'
end)) || '@' ||
trim(to_char(case
when (a.hedge_type = '0') then
'S'
else
'H'
end)) || '@' ||
(case
when a.drop_profit = 0 then
'0.00'
else
trim(to_char(a.drop_profit,
'999999999999999999999999999990.99'))
end) || '@' || (case
when a.drop_profit_float = 0 then
'0.00'
else
trim(to_char(a.drop_profit_float,
'999999999999999999999999999990.99'))
end) || '@' ||
(case
when a.total_fare = 0 then
'0.00'
else
trim(to_char(a.total_fare,
'999999999999999999999999999990.99'))
end) || '@' ||
right('00000000' || a.futures_account, 8) || '@' || trim(to_char(case when(a.futu_exch_type = 'F1') then 'Z' when(a.futu_exch_type = 'F2') then 'D' when(a.futu_exch_type = 'F3') then 'S' when(a.futu_exch_type = 'F4') then 'J' else 'A' end)) || '@' || (case when a.branch_no in ('217', '273', '184', '183', '102', '2341', '301', '288', '226', '232', '246', '279', '243', '16', '302') then 'Y' else 'N' end) || '@' ||
right('000000000000' || trim(nvl(c.FUTU_REPORT_NO, ' ')), 12) || '@' || trim(nvl(c.report_seat_no, ' ')) as xx, a.position_str
from hs_his.hisfuholddrop a,
(select *
from (select b.branch_no,
b.entrust_no,
b.FUTU_REPORT_NO,
z.report_seat_no,
z.init_date
from hs_his.hisfuentrust b, hs_his.hisfuentrustrsp z
where b.init_date = 20120514
and z.init_date = 20120514
and b.futu_report_no = z.futu_report_no
and b.confirm_no = z.confirm_no
and b.futu_exch_type = z.futu_exch_type
and b.seat_no = z.seat_no
and b.futures_account = z.futures_account
and z.futu_entrust_type <> '2'
and z.futu_entrust_type <> '4')
group by init_date,
branch_no,
entrust_no,
FUTU_REPORT_NO,
report_seat_no
having init_date = 20120514 and count(*) = 1) c
where a.entrust_no = c.entrust_no(+)
and a.branch_no = c.branch_no(+)
and a.init_date = 20120514
and a.fund_account > 0
and ((0 = 0) or (a.fund_account >= 0))
and ((0 = 0) or (a.fund_account <= 0))
and a.futures_direction <> '3'
and a.position_str > '0'
order by a.position_str)
where rownum <= 5000
file:///D:/Program%20Files/Tencent/QQ/Users/254034831/Image/P9V`07P@}TWPS_FI(XTI%PA.jpg